summaryrefslogtreecommitdiff
path: root/src/ansi.rs
diff options
context:
space:
mode:
authorChristian Duerr <chrisduerr@users.noreply.github.com>2018-03-04 22:40:15 +0000
committerGitHub <noreply@github.com>2018-03-04 22:40:15 +0000
commit7f2b398ad2084bdaaa266e8da770a213f0a9a2eb (patch)
tree9d249fd13e80c9ca2d03f37fd6147fbc1ee8ba4a /src/ansi.rs
parent475ebecfc4e0648242e82e256dee1489f3a3fe81 (diff)
downloadalacritty-7f2b398ad2084bdaaa266e8da770a213f0a9a2eb.tar.gz
alacritty-7f2b398ad2084bdaaa266e8da770a213f0a9a2eb.zip
Remove all instances of unwrap() from config
Unwrapping inside the config file parsing can lead to some issues that prevent us from falling back to a default configuration file. One instance of that issue was mentioned in #1135. Now all instances of `unwrap()` have been removed and replaced with proper error handling. This will make the config more robust and prevents live reload from silently breaking while alacritty is running. This also fixes a few currently existing clippy issues. Clippy added an additonal lint which complains about `MyStruct { field: field }`. These issues have been fixed, except for some false-positives and issues in external macros which will probably be fixed with future updates (rust-lang-nursery/bitflags#149)
Diffstat (limited to 'src/ansi.rs')
-rw-r--r--src/ansi.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ansi.rs b/src/ansi.rs
index 3bcfff88..b59959f5 100644
--- a/src/ansi.rs
+++ b/src/ansi.rs
@@ -65,7 +65,7 @@ fn parse_rgb_color(color: &[u8]) -> Option<Rgb> {
if next!() != Some('/') { return None; }
let b = parse_hex!();
- Some(Rgb { r: r, g: g, b: b})
+ Some(Rgb { r, g, b })
}
Some('#') => {
Some(Rgb {
@@ -128,8 +128,8 @@ impl<'a, H: Handler + TermInfo + 'a, W: io::Write> Performer<'a, H, W> {
) -> Performer<'b, H, W> {
Performer {
_state: state,
- handler: handler,
- writer: writer,
+ handler,
+ writer,
}
}
}