diff --git a/src/lib.rs b/src/lib.rs index 1918543..327e2d7 100644 --- a/src/lib.rs +++ b/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::>(); -//! 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::>(); +//! 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)]