clippy fix
This commit is contained in:
parent
6cb4d04cef
commit
40e6da5e97
26
src/lib.rs
26
src/lib.rs
@ -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)]
|
||||
|
Loading…
Reference in New Issue
Block a user