clippy fix

This commit is contained in:
Philipp Schuster 2021-10-04 14:40:15 +02:00
parent 6cb4d04cef
commit 40e6da5e97
1 changed files with 12 additions and 14 deletions

View File

@ -43,21 +43,19 @@ SOFTWARE.
//! ```rust
//! use tar_no_std::TarArchive;
//!
//! fn main() {
//! // log: not mandatory
//! std::env::set_var("RUST_LOG", "trace");
//! env_logger::init();
//! // log: not mandatory
//! std::env::set_var("RUST_LOG", "trace");
//! env_logger::init();
//!
//! // also works in no_std environment (except the println!, of course)
//! let archive = include_bytes!("../tests/gnu_tar_default.tar");
//! let archive = TarArchive::new(archive);
//! // Vec needs an allocator of course, but the library itself doesn't need one
//! let entries = archive.entries().collect::<Vec<_>>();
//! println!("{:#?}", entries);
//! println!("content of last file:");
//! let last_file_content = unsafe { core::str::from_utf8_unchecked(entries[2].data()) };
//! println!("{:#?}", last_file_content);
//! }
//! // also works in no_std environment (except the println!, of course)
//! let archive = include_bytes!("../tests/gnu_tar_default.tar");
//! let archive = TarArchive::new(archive);
//! // Vec needs an allocator of course, but the library itself doesn't need one
//! let entries = archive.entries().collect::<Vec<_>>();
//! println!("{:#?}", entries);
//! println!("content of last file:");
//! let last_file_content = unsafe { core::str::from_utf8_unchecked(entries[2].data()) };
//! println!("{:#?}", last_file_content);
//! ```
#![cfg_attr(not(test), no_std)]