Skip to content

Commit

Permalink
docs: Fix clippy findings in rustdoc doctests
Browse files Browse the repository at this point in the history
Signed-off-by: robot9001 <[email protected]>
  • Loading branch information
robo9k committed Sep 28, 2023
1 parent 96606b7 commit 87de274
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ fn file_example() -> Result<(), magic::MagicError> {
let cookie = magic::Cookie::open(magic::CookieFlags::ERROR)?;

// Load a specific database (so exact text assertion below works regardless of the system's default database)
cookie.load(&vec!["data/tests/db-images-png"])?;
cookie.load(&["data/tests/db-images-png"])?;

let file = "data/tests/rust-logo-128x128-blk.png";

Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,14 @@
//! let cookie = magic::Cookie::open(magic::CookieFlags::ERROR)?;
//!
//! // Load a specific database (so exact text assertion below works regardless of the system's default database)
//! cookie.load(&vec!["data/tests/db-images-png"])?;
//! cookie.load(&["data/tests/db-images-png"])?;
//! // You can instead load the default database
//! //cookie.load::<&str>(&[])?;
//!
//! // Analyze a test file
//! let file_to_analyze = "data/tests/rust-logo-128x128-blk.png";
//! let expected_analysis_result = "PNG image data, 128 x 128, 8-bit/color RGBA, non-interlaced";
//! assert_eq!(cookie.file(&file_to_analyze)?, expected_analysis_result);
//! assert_eq!(cookie.file(file_to_analyze)?, expected_analysis_result);
//! # Ok(())
//! # }
//! ```
Expand Down Expand Up @@ -441,7 +441,7 @@ impl Cookie {
/// cookie.load::<&str>(&[])?;
///
/// // Load databases from files
/// cookie.load(&vec!["data/tests/db-images-png", "data/tests/db-python"])?;
/// cookie.load(&["data/tests/db-images-png", "data/tests/db-python"])?;
/// # Ok(())
/// # }
#[doc(alias = "magic_load")]
Expand Down

0 comments on commit 87de274

Please sign in to comment.