fix some documentation issues
This commit is contained in:
parent
3840e7d65f
commit
ed0da9da59
2 changed files with 8 additions and 8 deletions
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "clippet"
|
name = "clippet"
|
||||||
description = "Provides a teeny way to have some nice byte structures that's easy to use."
|
description = "Provides a teeny way to have some nice byte structures that's easy to use."
|
||||||
version = "0.1.1"
|
version = "0.1.2"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
authors = ["Celeste <colean@colean.cc>"]
|
authors = ["Celeste <colean@colean.cc>"]
|
||||||
license = "LGPL-3.0-or-later"
|
license = "LGPL-3.0-or-later"
|
||||||
|
|
14
src/lib.rs
14
src/lib.rs
|
@ -18,7 +18,7 @@ pub struct Clippet {
|
||||||
impl Clippet {
|
impl Clippet {
|
||||||
/// Returns the label field.
|
/// Returns the label field.
|
||||||
///
|
///
|
||||||
/// ```no-run
|
/// ```no_run
|
||||||
/// let data = Clippet { label : "Hello!".to_string(), ... };
|
/// let data = Clippet { label : "Hello!".to_string(), ... };
|
||||||
/// assert_eq!(data.get_label(), "Hello!")
|
/// assert_eq!(data.get_label(), "Hello!")
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -27,7 +27,7 @@ impl Clippet {
|
||||||
}
|
}
|
||||||
/// Changes the label field.
|
/// Changes the label field.
|
||||||
///
|
///
|
||||||
/// ```no-run
|
/// ```no_run
|
||||||
/// let data = Clippet { ... };
|
/// let data = Clippet { ... };
|
||||||
/// assert_eq!(data.set_label("Hello!"), true);
|
/// assert_eq!(data.set_label("Hello!"), true);
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -42,7 +42,7 @@ impl Clippet {
|
||||||
/// Appends a sequence of bytes to the Clippet structure.
|
/// Appends a sequence of bytes to the Clippet structure.
|
||||||
/// Also increases the size field by one.
|
/// Also increases the size field by one.
|
||||||
///
|
///
|
||||||
/// ```no-run
|
/// ```no_run
|
||||||
/// let bytes = BytesMut::from("Hello, world!");
|
/// let bytes = BytesMut::from("Hello, world!");
|
||||||
/// let mut data = Clippet { ... };
|
/// let mut data = Clippet { ... };
|
||||||
/// data.add_bytes(bytes);
|
/// data.add_bytes(bytes);
|
||||||
|
@ -54,7 +54,7 @@ impl Clippet {
|
||||||
/// Removes a sequence of bytes from the Clippet structure.
|
/// Removes a sequence of bytes from the Clippet structure.
|
||||||
/// Also decreases the size field by one.
|
/// Also decreases the size field by one.
|
||||||
///
|
///
|
||||||
/// ```no-run
|
/// ```no_run
|
||||||
/// let mut data = Clippet { ... };
|
/// let mut data = Clippet { ... };
|
||||||
/// data.get_size() // e.g. 10
|
/// data.get_size() // e.g. 10
|
||||||
/// data.drop_bytes(5) // drops 6th sequence of bytes
|
/// data.drop_bytes(5) // drops 6th sequence of bytes
|
||||||
|
@ -66,7 +66,7 @@ impl Clippet {
|
||||||
}
|
}
|
||||||
/// Returns the size of the data field.
|
/// Returns the size of the data field.
|
||||||
///
|
///
|
||||||
/// ```no-run
|
/// ```no_run
|
||||||
/// let data = Clippet { ... };
|
/// let data = Clippet { ... };
|
||||||
/// assert_eq!(data.get_size(), 0);
|
/// assert_eq!(data.get_size(), 0);
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -75,7 +75,7 @@ impl Clippet {
|
||||||
}
|
}
|
||||||
/// Returns a sequence of bytes.
|
/// Returns a sequence of bytes.
|
||||||
///
|
///
|
||||||
/// ```no-run
|
/// ```no_run
|
||||||
/// let bytes = BytesMut::from("Hello, world!");
|
/// let bytes = BytesMut::from("Hello, world!");
|
||||||
/// let mut data = Clippet { ... };
|
/// let mut data = Clippet { ... };
|
||||||
/// data.add_bytes(bytes);
|
/// data.add_bytes(bytes);
|
||||||
|
@ -87,7 +87,7 @@ impl Clippet {
|
||||||
/// Takes a filename and splits it into sequences of bytes within a Clippet.
|
/// Takes a filename and splits it into sequences of bytes within a Clippet.
|
||||||
/// It is recommended to use smaller byte sequences, however this is user-configurable.
|
/// It is recommended to use smaller byte sequences, however this is user-configurable.
|
||||||
///
|
///
|
||||||
/// ```no-run
|
/// ```no_run
|
||||||
/// let data = Clippet::from_file("example.txt", 512);
|
/// let data = Clippet::from_file("example.txt", 512);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn from_file(name: &str, size: usize) -> Clippet {
|
pub fn from_file(name: &str, size: usize) -> Clippet {
|
||||||
|
|
Reference in a new issue