diff --git a/.travis.yml b/.travis.yml index d21ee2d..bdd2271 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/src/lib.rs b/src/lib.rs index 006a1e8..952253c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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(); //! } //! ```