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.
This commit is contained in:
parent
e367f23c01
commit
f602e84fa6
1 changed files with 5 additions and 7 deletions
12
README.md
12
README.md
|
|
@ -106,13 +106,11 @@ docker run --rm -v $(pwd):/work ghcr.io/shssoichiro/oxipng -o 4 /work/file.png
|
||||||
## Library Usage
|
## Library Usage
|
||||||
|
|
||||||
Although originally intended to be used as an executable, Oxipng can also be used as a library in
|
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,
|
other Rust projects. To do so, simply add Oxipng as a dependency in your Cargo.toml. You should then
|
||||||
then `extern crate oxipng` in your project. You should then have access to all of the library
|
have access to all of the library functions [documented here](https://docs.rs/oxipng). The simplest
|
||||||
functions [documented here](https://docs.rs/oxipng). The simplest
|
method of usage involves creating an [Options
|
||||||
method of usage involves creating an
|
struct](https://docs.rs/oxipng/latest/oxipng/struct.Options.html) and passing it, along with an
|
||||||
[Options struct](https://docs.rs/oxipng/latest/oxipng/struct.Options.html) and
|
input filename, into the [optimize function](https://docs.rs/oxipng/latest/oxipng/fn.optimize.html).
|
||||||
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
|
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
|
no simple way to just disable one feature in Cargo, it has to be done by disabling default features
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue