Skip to content

Commit

Permalink
#104 doc
Browse files Browse the repository at this point in the history
  • Loading branch information
yegor256 committed Mar 17, 2023
1 parent ef2535d commit 38818bc
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/serialization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ impl Sodg {
/// Save the entire [`Sodg`] into a binary file.
///
/// The entire [`Sodg`] can be restored from the file.
/// The function returns the size of the file just saved.
/// The function returns the size of the file just saved. In order
/// to restore from the file, use [`Sodg::load`].
pub fn save(&self, path: &Path) -> Result<usize> {
let start = Instant::now();
let bytes: Vec<u8> = serialize(self).context("Failed to serialize")?;
Expand All @@ -47,7 +48,7 @@ impl Sodg {
}

/// Load the entire [`Sodg`] from a binary file previously
/// created by `save()`.
/// created by [`Sodg::save`].
pub fn load(path: &Path) -> Result<Sodg> {
let start = Instant::now();
let bytes = fs::read(path).context(format!("Can't read from {}", path.display()))?;
Expand Down

0 comments on commit 38818bc

Please sign in to comment.