diff options
author | Pietro Albini <pietro@pietroalbini.org> | 2020-12-10 14:10:30 +0100 |
---|---|---|
committer | Pietro Albini <pietro@pietroalbini.org> | 2020-12-10 16:25:24 +0100 |
commit | bb072fe8e77e0533d256a47a0e36d001d6fb18e5 (patch) | |
tree | 823050c16d1f9cd6ea987ab9a6fd84d2f574bc35 /src/util.rs | |
parent | d66f476b4d5e7fdf1ec215c9ac16c923dc292324 (diff) | |
download | rust-installer-bb072fe8e77e0533d256a47a0e36d001d6fb18e5.tar.gz |
main: allow fallible conversions during CLI parsing
Diffstat (limited to 'src/util.rs')
-rw-r--r-- | src/util.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/util.rs b/src/util.rs index 3ddcfc6..078ceb3 100644 --- a/src/util.rs +++ b/src/util.rs @@ -142,8 +142,8 @@ macro_rules! actor { impl $name { $( $( #[ $field_attr ] )+ - pub fn $field<T: Into<$type>>(&mut self, value: T) -> &mut Self { - self.$field = value.into(); + pub fn $field(&mut self, value: $type) -> &mut Self { + self.$field = value; self })+ } |