diff --git a/.rustfmt.toml b/.rustfmt.toml index 1680bc55c..ccb23af11 100644 --- a/.rustfmt.toml +++ b/.rustfmt.toml @@ -1,3 +1,2 @@ # Please keep these in alphabetical order. tab_spaces = 4 -wrap_comments = true diff --git a/src/caps/mod.rs b/src/caps/mod.rs index 517b5f6c2..bdd01992f 100644 --- a/src/caps/mod.rs +++ b/src/caps/mod.rs @@ -170,7 +170,8 @@ impl Capabilities { _ => { // COLORTERM isn't set, so look at the terminfo. if let Some(ref db) = hints.terminfo_db.as_ref() { - let has_true_color = db.get::() + let has_true_color = db + .get::() .unwrap_or(cap::TrueColor(false)) .0; if has_true_color { diff --git a/src/keymap.rs b/src/keymap.rs index 229ece5b8..fa5ca9a42 100644 --- a/src/keymap.rs +++ b/src/keymap.rs @@ -23,7 +23,8 @@ impl Node { self.value = Some(value); return; } - match self.children + match self + .children .binary_search_by(|node| node.label.cmp(&key[0])) { Ok(idx) => { @@ -54,7 +55,8 @@ impl Node { }; } - match self.children + match self + .children .binary_search_by(|node| node.label.cmp(&key[0])) { Ok(idx) => { diff --git a/src/surface.rs b/src/surface.rs index 50d2abd98..3573689f1 100644 --- a/src/surface.rs +++ b/src/surface.rs @@ -780,14 +780,16 @@ impl Surface { // lines of text into simpler strings. let mut attr: Option = None; - for ((row_num, line), other_line) in self.lines + for ((row_num, line), other_line) in self + .lines .iter() .enumerate() .skip(y) .take_while(|(row_num, _)| *row_num < y + height) .zip(other.lines.iter().skip(other_y)) { - for ((col_num, cell), (_, other_cell)) in line.visible_cells() + for ((col_num, cell), (_, other_cell)) in line + .visible_cells() .skip(x) .take_while(|(col_num, _)| *col_num < x + width) .zip(other_line.visible_cells().skip(other_x)) diff --git a/src/widgets/layout.rs b/src/widgets/layout.rs index ebc62a9ce..437fdd114 100644 --- a/src/widgets/layout.rs +++ b/src/widgets/layout.rs @@ -277,7 +277,8 @@ impl LayoutState { parent_top: usize, results: &mut Vec, ) -> Result<(), Error> { - let state = self.widget_states + let state = self + .widget_states .get(&widget) .ok_or_else(|| err_msg("widget has no solver state"))?; let width = self.solver.get_value(state.width) as usize; @@ -310,7 +311,8 @@ impl LayoutState { parent_left: Option, parent_top: Option, ) -> Result { - let state = self.widget_states + let state = self + .widget_states .get(&widget) .ok_or_else(|| err_msg("widget has no solver state"))? .clone(); @@ -343,25 +345,31 @@ impl LayoutState { // We handle alignment on the root widget specially here; // for non-root widgets, we handle it when assessing children match state.constraints.halign { - HorizontalAlignment::Left => self.solver + HorizontalAlignment::Left => self + .solver .add_constraint(state.left | EQ(STRONG) | 0.0) .map_err(adderr)?, - HorizontalAlignment::Right => self.solver + HorizontalAlignment::Right => self + .solver .add_constraint(state.left | EQ(STRONG) | parent_width - state.width) .map_err(adderr)?, - HorizontalAlignment::Center => self.solver + HorizontalAlignment::Center => self + .solver .add_constraint(state.left | EQ(STRONG) | (parent_width - state.width) / 2.0) .map_err(adderr)?, } match state.constraints.valign { - VerticalAlignment::Top => self.solver + VerticalAlignment::Top => self + .solver .add_constraint(state.top | EQ(STRONG) | 0.0) .map_err(adderr)?, - VerticalAlignment::Bottom => self.solver + VerticalAlignment::Bottom => self + .solver .add_constraint(state.top | EQ(STRONG) | parent_height - state.height) .map_err(adderr)?, - VerticalAlignment::Middle => self.solver + VerticalAlignment::Middle => self + .solver .add_constraint(state.top | EQ(STRONG) | (parent_height - state.height) / 2.0) .map_err(adderr)?, } @@ -438,17 +446,20 @@ impl LayoutState { )?; match child_state.constraints.halign { - HorizontalAlignment::Left => self.solver + HorizontalAlignment::Left => self + .solver .add_constraint(child_state.left | EQ(STRONG) | left_edge.clone()) .map_err(adderr)?, - HorizontalAlignment::Right => self.solver + HorizontalAlignment::Right => self + .solver .add_constraint( child_state.left + child_state.width | EQ(STRONG) | state.left + state.width, ) .map_err(adderr)?, - HorizontalAlignment::Center => self.solver + HorizontalAlignment::Center => self + .solver .add_constraint( child_state.left | EQ(STRONG) @@ -458,17 +469,20 @@ impl LayoutState { } match child_state.constraints.valign { - VerticalAlignment::Top => self.solver + VerticalAlignment::Top => self + .solver .add_constraint(child_state.top | EQ(STRONG) | top_edge.clone()) .map_err(adderr)?, - VerticalAlignment::Bottom => self.solver + VerticalAlignment::Bottom => self + .solver .add_constraint( child_state.top + child_state.height | EQ(STRONG) | state.top + state.height, ) .map_err(adderr)?, - VerticalAlignment::Middle => self.solver + VerticalAlignment::Middle => self + .solver .add_constraint( child_state.top | EQ(STRONG)