From f602e84fa6fdfe0eb23dd2c94123d8f0e9eb4bed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= Date: Mon, 25 Nov 2024 18:59:38 +0100 Subject: [PATCH] Remove obsolete `extern crate oxipng` advice in lib usage instructions This syntax hasn't been required since at least Rust's 2018 edition, except in very specialized scenarios where you want to convince the compiler that a crate is actually used to guarantee that the side-effects of its build script (e.g., library linking) are visible, which do not apply to Oxipng in any case. --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 0c2344e8..cdf4b4d2 100644 --- a/README.md +++ b/README.md @@ -106,13 +106,11 @@ docker run --rm -v $(pwd):/work ghcr.io/shssoichiro/oxipng -o 4 /work/file.png ## Library Usage Although originally intended to be used as an executable, Oxipng can also be used as a library in -other Rust projects. To do so, simply add Oxipng as a dependency in your Cargo.toml, -then `extern crate oxipng` in your project. You should then have access to all of the library -functions [documented here](https://docs.rs/oxipng). The simplest -method of usage involves creating an -[Options struct](https://docs.rs/oxipng/latest/oxipng/struct.Options.html) and -passing it, along with an input filename, into the -[optimize function](https://docs.rs/oxipng/latest/oxipng/fn.optimize.html). +other Rust projects. To do so, simply add Oxipng as a dependency in your Cargo.toml. You should then +have access to all of the library functions [documented here](https://docs.rs/oxipng). The simplest +method of usage involves creating an [Options +struct](https://docs.rs/oxipng/latest/oxipng/struct.Options.html) and passing it, along with an +input filename, into the [optimize function](https://docs.rs/oxipng/latest/oxipng/fn.optimize.html). It is recommended to disable the "binary" feature when including Oxipng as a library. Currently, there is no simple way to just disable one feature in Cargo, it has to be done by disabling default features