summary refs log tree commit diff
path: root/src/argument.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/argument.rs')
-rw-r--r--src/argument.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/argument.rs b/src/argument.rs
index f59d503..9c00ae5 100644
--- a/src/argument.rs
+++ b/src/argument.rs
@@ -25,7 +25,7 @@
 //!             let v: u32 = value.unwrap().parse().map_err(|_| {
 //!                 Error::InvalidValue {
 //!                     value: value.unwrap().to_owned(),
-//!                     expected: "this value for `cpus` needs to be integer",
+//!                     expected: String::from("this value for `cpus` needs to be integer"),
 //!                 }
 //!             })?;
 //!         }
@@ -56,10 +56,7 @@ pub enum Error {
     /// The argument was required.
     ExpectedArgument(String),
     /// The argument's given value is invalid.
-    InvalidValue {
-        value: String,
-        expected: &'static str,
-    },
+    InvalidValue { value: String, expected: String },
     /// The argument was already given and none more are expected.
     TooManyArguments(String),
     /// The argument expects a value.
@@ -447,7 +444,7 @@ mod tests {
                     "cpus" => {
                         let c: u32 = value.unwrap().parse().map_err(|_| Error::InvalidValue {
                             value: value.unwrap().to_owned(),
-                            expected: "this value for `cpus` needs to be integer",
+                            expected: String::from("this value for `cpus` needs to be integer"),
                         })?;
                         assert_eq!(c, 3);
                     }
@@ -521,7 +518,7 @@ mod tests {
                                     _ => {
                                         return Err(Error::InvalidValue {
                                             value: v.to_string(),
-                                            expected: "2D or 3D",
+                                            expected: String::from("2D or 3D"),
                                         })
                                     }
                                 }