Skip to content

Commit

Permalink
docs: Fix README.md and documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
marcoradocchia committed Nov 29, 2023
1 parent 1c4c3b0 commit 8508759
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 17 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ we construct a new instance, which translates to `/proc/meminfo` being opened
and read into the internal buffer; then we call the `MemInfo::parse`, which
returns a **lazy** iterator over parsed entries, in this case represented by
the `MemInfoEntry` type. The iterator being lazy meaning it parses a new
entry on each call to the `next` method. In other words: _pay only for the
entry on each call to the `next` method. In other words: _you only pay for the
entries you parse_.

```rust
Expand All @@ -55,14 +55,14 @@ fn main() -> Result<(), Box<dyn error::Error>> {
}
```

In certain scenarios, users may have distinct use cases that necessitate regular
retrieval of a particular set of entries within the `/proc/meminfo` pseudofile.
The `MemInfo::parse_extended` addresses this requirement in an efficient
fashion, extending parsed entries with additional information pertaining to the
byte range they occupy in the file stream. This functionality allows users to
selectively read and parse specific entries as needed. Also, this way, the
internal buffer can be shrank to the capacity required to read in such entries,
reducing the runtime memory footprint of the program. Below a minimal example:
Users may have distinct use cases that call for regular retrieval of a
particular set of entries within the `/proc/meminfo` pseudofile. The
`MemInfo::parse_extended` efficiently addresses this requirement, extending
parsed entries with additional information pertaining to the byte range they
occupy in the file stream. This functionality allows users to selectively read
and parse specific entries as needed. Also, this way, the internal buffer can
be shrank to the capacity required to read in such entries, reducing the runtime
memory footprint of the program.

```rust
use std::io::SeekFrom;
Expand Down
17 changes: 9 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
//! a new instance, which translates to `/proc/meminfo` being opened and read into the internal
//! buffer; then we call the [`MemInfo::parse`], which returns a **lazy** iterator over parsed
//! entries, in this case represented by the [`MemInfoEntry`] type. The iterator being lazy
//! meaning it parses a new entry on each call to the `next` method. In other words: _pay only
//! meaning it parses a new entry on each call to the `next` method. In other words: _you only pay
//! for the entries you parse_.
//!
//! ```rust
Expand All @@ -41,13 +41,14 @@
//! Ok(())
//! }
//! ```
//! In certain scenarios, users may have distinct use cases that necessitate regular retrieval of
//! a particular set of entries within the `/proc/meminfo` pseudofile. The
//! [`MemInfo::parse_extended`] addresses this requirement in an efficient fashion, extending
//! parsed entries with additional information pertaining to the byte range they occupy in the file
//! stream. This functionality allows users to selectively read and parse specific entries as
//! needed. Also, this way, the internal buffer can be shrank to the capacity required to read in
//! such entries, reducing the runtime memory footprint of the program
//!
//! Users may have distinct use cases that call for regular retrieval of a particular set of
//! entries within the `/proc/meminfo` pseudofile. The [`MemInfo::parse_extended`] efficiently
//! addresses this requirement, extending parsed entries with additional information pertaining to
//! the byte range they occupy in the file stream. This functionality allows users to selectively
//! read and parse specific entries as needed. Also, this way, the internal buffer can be shrank to
//! the capacity required to read in such entries, reducing the runtime memory footprint of the
//! program.
//!
//! ```no_run
//! use std::io::SeekFrom;
Expand Down

0 comments on commit 8508759

Please sign in to comment.