diff --git a/Cargo.lock b/Cargo.lock index 5b48d6c..59c842c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,7 +65,7 @@ checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e" [[package]] name = "merlin" -version = "1.0.9" +version = "1.0.11" dependencies = [ "clap", "shellexpand", diff --git a/Cargo.toml b/Cargo.toml index e2d9644..e5a63b3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "merlin" -version = "1.0.10" +version = "1.0.11" authors = ["geremachek "] edition = "2018" diff --git a/src/plane/parse.rs b/src/plane/parse.rs index 7c940f6..c81a3ad 100644 --- a/src/plane/parse.rs +++ b/src/plane/parse.rs @@ -158,7 +158,7 @@ impl Plane { Command::Carve => cvol.carve()?, Command::Carved => return oksome(cvol.carved()), _ => { // we are modifying the buffer... - cvol.set_written(false); + cvol.written = false; match command { Command::Inscribe => cvol.inscribe(&data[0]), diff --git a/src/volume/mod.rs b/src/volume/mod.rs index d5dfdbb..4f90d85 100644 --- a/src/volume/mod.rs +++ b/src/volume/mod.rs @@ -16,16 +16,10 @@ pub struct Volume { line: usize, cursor: usize, - written: bool, + pub written: bool, } impl Volume { - // set written to a boolean value - - pub fn set_written(&mut self, w: bool) { - self.written = w; - } - // create a buffer with some existing text pub fn from_text(contents: String) -> Volume { diff --git a/src/volume/vol_commands.rs b/src/volume/vol_commands.rs index 45c2f1d..8dbc5d5 100644 --- a/src/volume/vol_commands.rs +++ b/src/volume/vol_commands.rs @@ -160,7 +160,7 @@ impl Volume { let mut file = File::create(&name).or(Err(MerlinError::CreationFailed))?; file.write_all(&(self.buffer.join("\n") + "\n").as_bytes()).or(Err(MerlinError::WriteFailed))?; - self.set_written(true); + self.written = true; Ok(()) } None => Err(MerlinError::BufferNotNamed),