fix some documentation issues

This commit is contained in:
abbie 2022-03-13 15:50:24 +00:00
parent 3840e7d65f
commit ed0da9da59
No known key found for this signature in database
GPG key ID: 04DDE463F9200F87
2 changed files with 8 additions and 8 deletions

View file

@ -1,7 +1,7 @@
[package]
name = "clippet"
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"
authors = ["Celeste <colean@colean.cc>"]
license = "LGPL-3.0-or-later"

View file

@ -18,7 +18,7 @@ pub struct Clippet {
impl Clippet {
/// Returns the label field.
///
/// ```no-run
/// ```no_run
/// let data = Clippet { label : "Hello!".to_string(), ... };
/// assert_eq!(data.get_label(), "Hello!")
/// ```
@ -27,7 +27,7 @@ impl Clippet {
}
/// Changes the label field.
///
/// ```no-run
/// ```no_run
/// let data = Clippet { ... };
/// assert_eq!(data.set_label("Hello!"), true);
/// ```
@ -42,7 +42,7 @@ impl Clippet {
/// Appends a sequence of bytes to the Clippet structure.
/// Also increases the size field by one.
///
/// ```no-run
/// ```no_run
/// let bytes = BytesMut::from("Hello, world!");
/// let mut data = Clippet { ... };
/// data.add_bytes(bytes);
@ -54,7 +54,7 @@ impl Clippet {
/// Removes a sequence of bytes from the Clippet structure.
/// Also decreases the size field by one.
///
/// ```no-run
/// ```no_run
/// let mut data = Clippet { ... };
/// data.get_size() // e.g. 10
/// data.drop_bytes(5) // drops 6th sequence of bytes
@ -66,7 +66,7 @@ impl Clippet {
}
/// Returns the size of the data field.
///
/// ```no-run
/// ```no_run
/// let data = Clippet { ... };
/// assert_eq!(data.get_size(), 0);
/// ```
@ -75,7 +75,7 @@ impl Clippet {
}
/// Returns a sequence of bytes.
///
/// ```no-run
/// ```no_run
/// let bytes = BytesMut::from("Hello, world!");
/// let mut data = Clippet { ... };
/// data.add_bytes(bytes);
@ -87,7 +87,7 @@ impl 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.
///
/// ```no-run
/// ```no_run
/// let data = Clippet::from_file("example.txt", 512);
/// ```
pub fn from_file(name: &str, size: usize) -> Clippet {