diff --git a/Cargo.toml b/Cargo.toml index 919d2ceb1..f205b5f0a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "zellij" version = "0.20.0" authors = ["Aram Drevekenin "] -edition = "2018" +edition = "2021" description = "A terminal workspace with batteries included" license = "MIT" repository = "https://github.com/zellij-org/zellij" diff --git a/default-plugins/status-bar/Cargo.toml b/default-plugins/status-bar/Cargo.toml index 407dd4990..ebcc743f7 100644 --- a/default-plugins/status-bar/Cargo.toml +++ b/default-plugins/status-bar/Cargo.toml @@ -2,7 +2,7 @@ name = "status-bar" version = "0.1.0" authors = ["Brooks J Rady "] -edition = "2018" +edition = "2021" license = "MIT" [dependencies] diff --git a/default-plugins/strider/Cargo.toml b/default-plugins/strider/Cargo.toml index d10598512..7506931a5 100644 --- a/default-plugins/strider/Cargo.toml +++ b/default-plugins/strider/Cargo.toml @@ -2,7 +2,7 @@ name = "strider" version = "0.2.0" authors = ["Brooks J Rady "] -edition = "2018" +edition = "2021" description = "A simplified ranger clone written as a Zellij plugin" license = "MIT" diff --git a/default-plugins/tab-bar/Cargo.toml b/default-plugins/tab-bar/Cargo.toml index 7fd6593dd..9911a4995 100644 --- a/default-plugins/tab-bar/Cargo.toml +++ b/default-plugins/tab-bar/Cargo.toml @@ -2,7 +2,7 @@ name = "tab-bar" version = "0.1.0" authors = ["Jonah Caplan "] -edition = "2018" +edition = "2021" license = "MIT" [dependencies] diff --git a/zellij-client/Cargo.toml b/zellij-client/Cargo.toml index 4faf25a27..92f9e5a3b 100644 --- a/zellij-client/Cargo.toml +++ b/zellij-client/Cargo.toml @@ -2,7 +2,7 @@ name = "zellij-client" version = "0.20.0" authors = ["Kunal Mohan "] -edition = "2018" +edition = "2021" description = "The client-side library for Zellij" license = "MIT" diff --git a/zellij-server/Cargo.toml b/zellij-server/Cargo.toml index 42f58251c..c96540ffe 100644 --- a/zellij-server/Cargo.toml +++ b/zellij-server/Cargo.toml @@ -2,7 +2,7 @@ name = "zellij-server" version = "0.20.0" authors = ["Kunal Mohan "] -edition = "2018" +edition = "2021" description = "The server-side library for Zellij" license = "MIT" diff --git a/zellij-server/src/panes/grid.rs b/zellij-server/src/panes/grid.rs index 4e9ef1581..75f349cfe 100644 --- a/zellij-server/src/panes/grid.rs +++ b/zellij-server/src/panes/grid.rs @@ -1515,7 +1515,6 @@ impl Perform for Grid { } dynamic_code += 1; } - return; } } } diff --git a/zellij-server/src/panes/terminal_character.rs b/zellij-server/src/panes/terminal_character.rs index ce5d89069..46483fb89 100644 --- a/zellij-server/src/panes/terminal_character.rs +++ b/zellij-server/src/panes/terminal_character.rs @@ -225,101 +225,90 @@ impl CharacterStyles { if self.foreground != new_styles.foreground { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.foreground(new_styles.foreground)); - self.foreground = new_styles.foreground; } else { diff = Some(CharacterStyles::new().foreground(new_styles.foreground)); - self.foreground = new_styles.foreground; } + self.foreground = new_styles.foreground; } if self.background != new_styles.background { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.background(new_styles.background)); - self.background = new_styles.background; } else { diff = Some(CharacterStyles::new().background(new_styles.background)); - self.background = new_styles.background; } + self.background = new_styles.background; } if self.strike != new_styles.strike { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.strike(new_styles.strike)); - self.strike = new_styles.strike; } else { diff = Some(CharacterStyles::new().strike(new_styles.strike)); - self.strike = new_styles.strike; } + self.strike = new_styles.strike; } if self.hidden != new_styles.hidden { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.hidden(new_styles.hidden)); - self.hidden = new_styles.hidden; } else { diff = Some(CharacterStyles::new().hidden(new_styles.hidden)); - self.hidden = new_styles.hidden; } + self.hidden = new_styles.hidden; } if self.reverse != new_styles.reverse { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.reverse(new_styles.reverse)); - self.reverse = new_styles.reverse; } else { diff = Some(CharacterStyles::new().reverse(new_styles.reverse)); - self.reverse = new_styles.reverse; } + self.reverse = new_styles.reverse; } if self.slow_blink != new_styles.slow_blink { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.blink_slow(new_styles.slow_blink)); - self.slow_blink = new_styles.slow_blink; } else { diff = Some(CharacterStyles::new().blink_slow(new_styles.slow_blink)); - self.slow_blink = new_styles.slow_blink; } + self.slow_blink = new_styles.slow_blink; } if self.fast_blink != new_styles.fast_blink { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.blink_fast(new_styles.fast_blink)); - self.fast_blink = new_styles.fast_blink; } else { diff = Some(CharacterStyles::new().blink_fast(new_styles.fast_blink)); - self.fast_blink = new_styles.fast_blink; } + self.fast_blink = new_styles.fast_blink; } if self.underline != new_styles.underline { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.underline(new_styles.underline)); - self.underline = new_styles.underline; } else { diff = Some(CharacterStyles::new().underline(new_styles.underline)); - self.underline = new_styles.underline; } + self.underline = new_styles.underline; } if self.bold != new_styles.bold { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.bold(new_styles.bold)); - self.bold = new_styles.bold; } else { diff = Some(CharacterStyles::new().bold(new_styles.bold)); - self.bold = new_styles.bold; } + self.bold = new_styles.bold; } if self.dim != new_styles.dim { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.dim(new_styles.dim)); - self.dim = new_styles.dim; } else { diff = Some(CharacterStyles::new().dim(new_styles.dim)); - self.dim = new_styles.dim; } + self.dim = new_styles.dim; } if self.italic != new_styles.italic { if let Some(new_diff) = diff.as_mut() { diff = Some(new_diff.italic(new_styles.italic)); - self.italic = new_styles.italic; } else { diff = Some(CharacterStyles::new().italic(new_styles.italic)); - self.italic = new_styles.italic; } + self.italic = new_styles.italic; } if let Some(changed_colors) = changed_colors { diff --git a/zellij-server/src/tab.rs b/zellij-server/src/tab.rs index 84a778621..e5586caaa 100644 --- a/zellij-server/src/tab.rs +++ b/zellij-server/src/tab.rs @@ -1738,14 +1738,10 @@ impl Tab { self.set_pane_frames(self.draw_pane_frames); } pub fn resize_whole_tab(&mut self, new_screen_size: Size) { - // FIXME: I *think* that Rust 2021 will let me just write this: - // let panes = self.panes.iter_mut().filter(|(pid, _)| !self.panes_to_hide.contains(pid)); - // In the meantime, let's appease our borrow-checker overlords: - let temp_panes_to_hide = &self.panes_to_hide; let panes = self .panes .iter_mut() - .filter(|(pid, _)| !temp_panes_to_hide.contains(pid)); + .filter(|(pid, _)| !self.panes_to_hide.contains(pid)); let Size { rows, cols } = new_screen_size; let mut resizer = PaneResizer::new(panes); if resizer.layout(Direction::Horizontal, cols).is_ok() { diff --git a/zellij-tile-utils/Cargo.toml b/zellij-tile-utils/Cargo.toml index 2e2fe98b1..70a7d46ff 100644 --- a/zellij-tile-utils/Cargo.toml +++ b/zellij-tile-utils/Cargo.toml @@ -2,7 +2,7 @@ name = "zellij-tile-utils" version = "0.20.0" authors = ["denis "] -edition = "2018" +edition = "2021" description = "A utility library for Zellij plugins" license = "MIT" diff --git a/zellij-tile/Cargo.toml b/zellij-tile/Cargo.toml index cf36a94b8..742bd4f18 100644 --- a/zellij-tile/Cargo.toml +++ b/zellij-tile/Cargo.toml @@ -2,7 +2,7 @@ name = "zellij-tile" version = "0.20.0" authors = ["Brooks J Rady "] -edition = "2018" +edition = "2021" description = "A small client-side library for writing Zellij plugins" license = "MIT" diff --git a/zellij-utils/Cargo.toml b/zellij-utils/Cargo.toml index e479e2822..eab045dde 100644 --- a/zellij-utils/Cargo.toml +++ b/zellij-utils/Cargo.toml @@ -2,7 +2,7 @@ name = "zellij-utils" version = "0.20.0" authors = ["Kunal Mohan "] -edition = "2018" +edition = "2021" description = "A utility library for Zellij client and server" license = "MIT"