aboutsummaryrefslogtreecommitdiff
path: root/src/term/mod.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/term/mod.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/term/mod.rs')
-rw-r--r--src/term/mod.rs26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/term/mod.rs b/src/term/mod.rs
index b11733f6..00244c8a 100644
--- a/src/term/mod.rs
+++ b/src/term/mod.rs
@@ -123,15 +123,15 @@ impl<'a> RenderableCellsIter<'a> {
let cursor_index = Linear(cursor.line.0 * grid.num_cols().0 + cursor.col.0);
RenderableCellsIter {
- grid: grid,
- cursor: cursor,
- cursor_index: cursor_index,
- mode: mode,
+ grid,
+ cursor,
+ cursor_index,
+ mode,
line: Line(0),
column: Column(0),
- selection: selection,
- config: config,
- colors: colors,
+ selection,
+ config,
+ colors,
cursor_cells: ArrayDeque::new(),
}.initialize(cursor_style)
}
@@ -396,13 +396,13 @@ impl<'a> Iterator for RenderableCellsIter<'a> {
}
return Some(RenderableCell {
- line: line,
- column: column,
+ line,
+ column,
flags: cell.flags,
c: cell.c,
fg: fg_rgb,
bg: bg_rgb,
- bg_alpha: bg_alpha,
+ bg_alpha,
})
}
@@ -816,7 +816,7 @@ impl Term {
visual_bell: VisualBell::new(config),
next_is_urgent: None,
input_needs_wrap: false,
- grid: grid,
+ grid,
alt_grid: alt,
alt: false,
font_size: config.font().size(),
@@ -825,9 +825,9 @@ impl Term {
cursor: Default::default(),
cursor_save: Default::default(),
cursor_save_alt: Default::default(),
- tabs: tabs,
+ tabs,
mode: Default::default(),
- scroll_region: scroll_region,
+ scroll_region,
size_info: size,
colors: color::List::from(config.colors()),
color_modified: [false; color::COUNT],