Fix doctest when feature can be changed.
This commit is contained in:
parent
200ebf40d6
commit
0e1c1fe1f6
|
@ -39,7 +39,7 @@ install:
|
||||||
script:
|
script:
|
||||||
- cargo test --no-default-features
|
- cargo test --no-default-features
|
||||||
- cargo test
|
- cargo test
|
||||||
- if [ "$TRAVIS_RUST_VERSION" = 'nightly' ]; then cargo bench; fi
|
- if [ "$TRAVIS_RUST_VERSION" = 'nightly' ]; then cargo bench --features=bench; fi
|
||||||
|
|
||||||
after_success:
|
after_success:
|
||||||
- cargo install cargo-kcov
|
- cargo install cargo-kcov
|
||||||
|
|
|
@ -4,9 +4,11 @@
|
||||||
//!
|
//!
|
||||||
//! ```
|
//! ```
|
||||||
//! extern crate qrcode;
|
//! extern crate qrcode;
|
||||||
|
//! # #[cfg(feature="image")]
|
||||||
//! extern crate image;
|
//! extern crate image;
|
||||||
//!
|
//!
|
||||||
//! use qrcode::QrCode;
|
//! use qrcode::QrCode;
|
||||||
|
//! # #[cfg(feature="image")]
|
||||||
//! use image::GrayImage;
|
//! use image::GrayImage;
|
||||||
//!
|
//!
|
||||||
//! fn main() {
|
//! fn main() {
|
||||||
|
@ -14,9 +16,11 @@
|
||||||
//! let code = QrCode::new(b"01234567").unwrap();
|
//! let code = QrCode::new(b"01234567").unwrap();
|
||||||
//!
|
//!
|
||||||
//! // Render the bits into an image.
|
//! // Render the bits into an image.
|
||||||
|
//! # #[cfg(feature="image")]
|
||||||
//! let image: GrayImage = code.render().to_image();
|
//! let image: GrayImage = code.render().to_image();
|
||||||
//!
|
//!
|
||||||
//! // Save the image.
|
//! // Save the image.
|
||||||
|
//! # #[cfg(feature="image")]
|
||||||
//! image.save("/tmp/qrcode.png").unwrap();
|
//! image.save("/tmp/qrcode.png").unwrap();
|
||||||
//! }
|
//! }
|
||||||
//! ```
|
//! ```
|
||||||
|
|
Loading…
Reference in a new issue