aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cli/cmd/mod.rs6
-rw-r--r--src/cli/cmd/write.rs (renamed from src/cli/cmd/save.rs)6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/cli/cmd/mod.rs b/src/cli/cmd/mod.rs
index 42e865a..e00b895 100644
--- a/src/cli/cmd/mod.rs
+++ b/src/cli/cmd/mod.rs
@@ -2,11 +2,11 @@
pub mod edit;
pub mod read;
-pub mod save;
+pub mod write;
pub use edit::*;
pub use read::*;
-pub use save::*;
+pub use write::*;
use crate::Editor;
use std::ops::RangeInclusive;
@@ -35,7 +35,7 @@ pub fn parse_command(string: &str) -> Result<Box<dyn Command>, CmdParseError> {
let parts: Vec<&str> = string.split_whitespace().collect();
match parts[0] {
- "w" => Ok(Box::new(Save::from_args(&parts[1..])?)),
+ "w" => Ok(Box::new(Write::from_args(&parts[1..])?)),
"e" => Ok(Box::new(Edit::from_args(&parts[1..])?)),
"r" => Ok(Box::new(Read::from_args(&parts[1..])?)),
other => Err(CmdParseError::NoSuchCmd(other.to_owned())),
diff --git a/src/cli/cmd/save.rs b/src/cli/cmd/write.rs
index 2c022cf..399045c 100644
--- a/src/cli/cmd/save.rs
+++ b/src/cli/cmd/write.rs
@@ -8,11 +8,11 @@ use std::path::PathBuf;
/// The save command can take any destination in the filesystem the user can write to. Processing
/// will then save the map contents to that destination, overwriting anything that may be there.
-pub struct Save {
+pub struct Write {
destination: PathBuf,
}
-impl FromArgs for Save {
+impl FromArgs for Write {
fn from_args(args: &[&str]) -> Result<Self, CmdParseError> {
if args.len() != 1 {
return Err(CmdParseError::WrongNumberOfArgs(args.len(), 1..=1));
@@ -24,7 +24,7 @@ impl FromArgs for Save {
}
}
-impl Command for Save {
+impl Command for Write {
fn process(&self, editor: &mut Editor) -> Result<String, String> {
let data = MapData::extract_data(editor.map());