diff options
author | Joe Wilm <joe@jwilm.com> | 2016-10-14 16:38:15 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-10-14 16:38:15 -0700 |
commit | 71de5501c450eeaa363aa5403a5258d231d64935 (patch) | |
tree | e2399301b7fde92f04389f74ae4215ee3f794f86 /src/config.rs | |
parent | 1d60fdd6e3eb4fb7d42a26de29af3bea56785564 (diff) | |
download | alacritty-71de5501c450eeaa363aa5403a5258d231d64935.tar.gz alacritty-71de5501c450eeaa363aa5403a5258d231d64935.zip |
Rustup and update dependencies
Now uses serde_dervive \o/
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/src/config.rs b/src/config.rs index 30bbf1b5..3c4d25c6 100644 --- a/src/config.rs +++ b/src/config.rs @@ -72,7 +72,7 @@ impl ::std::fmt::Display for Error { write!(f, "could not read $HOME environment variable: {}", err) }, Error::Io(ref err) => write!(f, "error reading config file: {}", err), - Error::Yaml(ref err) => write!(f, "problem with config: {}", err), + Error::Yaml(ref err) => write!(f, "problem with config: {:?}", err), } } } @@ -240,26 +240,18 @@ impl DeserializeFromF32 for Size { impl<__D> ::serde::de::Visitor for FloatVisitor<__D> where __D: ::serde::de::Deserializer { - type Value = f32; + type Value = f64; - fn visit_f32<E>(&mut self, value: f32) -> ::std::result::Result<Self::Value, E> + fn visit_f64<E>(&mut self, value: f64) -> ::std::result::Result<Self::Value, E> where E: ::serde::de::Error { Ok(value) } - - fn visit_str<E>(&mut self, value: &str) -> ::std::result::Result<Self::Value, E> - where E: ::serde::de::Error - { - // FIXME serde-yaml visits a str for real numbers. - // https://github.com/dtolnay/serde-yaml/issues/24 - Ok(value.parse::<f32>().expect("size must be float")) - } } deserializer - .deserialize_f32(FloatVisitor::<D>{ _marker: PhantomData }) - .map(|v| Size::new(v)) + .deserialize_f64(FloatVisitor::<D>{ _marker: PhantomData }) + .map(|v| Size::new(v as _)) } } |