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