Skip to content

Commit c059425

Browse files
authored
bump rust version to 1.92, same as we use in warp-internal (#185)
1 parent 1b897d1 commit c059425

7 files changed

Lines changed: 12 additions & 17 deletions

File tree

command-signatures/src/generators/git.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ fn post_process_git_for_each_ref(output: &str) -> GeneratorResults {
456456
output
457457
.split('\n')
458458
.unique()
459-
.filter(|&line| (!line.is_empty()))
459+
.filter(|&line| !line.is_empty())
460460
.map(|line| {
461461
Suggestion::with_description(line.trim(), "Branch").with_icon(IconType::GitBranch)
462462
})
@@ -671,7 +671,7 @@ pub fn generator() -> CommandSignatureGenerators {
671671
|output| {
672672
output
673673
.lines()
674-
.filter(|&line| (!line.is_empty())).map(|line| Suggestion::with_description(line, "tag"))
674+
.filter(|&line| !line.is_empty()).map(|line| Suggestion::with_description(line, "tag"))
675675
.collect_ordered_results()
676676
},
677677
),

command-signatures/src/generators/man.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ pub fn generator() -> CommandSignatureGenerators {
3939
|output| {
4040
output
4141
.split('\n')
42-
.filter(|&line| (!line.is_empty() && !line.starts_with('/')))
42+
.filter(|&line| !line.is_empty() && !line.starts_with('/'))
4343
.map(|line| Suggestion::with_description(line.trim(), "Man page"))
4444
.collect_ordered_results()
4545
},

command-signatures/src/generators/pyenv.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn generator() -> CommandSignatureGenerators {
1818
output
1919
.split('\n')
2020
.skip(1)
21-
.filter(|&line| (!line.is_empty()))
21+
.filter(|&line| !line.is_empty())
2222
.map(|line| Suggestion::new(line.trim()))
2323
.collect_unordered_results()
2424
},
@@ -29,7 +29,7 @@ pub fn generator() -> CommandSignatureGenerators {
2929
Generator::script(CommandBuilder::single_command("pyenv versions"), |output| {
3030
output
3131
.split('\n')
32-
.filter(|&line| (!line.is_empty()))
32+
.filter(|&line| !line.is_empty())
3333
.map(|line| {
3434
if RE.is_match(line) {
3535
Suggestion::new(line.replace('*', "").trim())

completion-metadata/src/command_builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ enum CommandPart {
1717
}
1818

1919
impl CommandPart {
20-
fn command(&self, shell: Shell) -> Cow<str> {
20+
fn command(&self, shell: Shell) -> Cow<'_, str> {
2121
match self {
2222
CommandPart::SingleCommand(command) => command.into(),
2323
CommandPart::And(command_1, command_2) => format!(
@@ -94,7 +94,7 @@ impl CommandBuilder {
9494
}
9595

9696
/// Returns the constructed command given the current shell type.
97-
pub fn build(&self, shell: Shell) -> Cow<str> {
97+
pub fn build(&self, shell: Shell) -> Cow<'_, str> {
9898
self.0.command(shell)
9999
}
100100
}

completion-metadata/src/lib.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ impl PathSuggestionType {
101101
}
102102
}
103103

104-
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize)]
104+
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Serialize, Deserialize)]
105105
pub enum Priority {
106106
/// Ordering for suggestions that can be ordered above or below all of the other suggestions
107107
/// (e.g. the current branch should be the first suggestion that shows up)
@@ -111,15 +111,10 @@ pub enum Priority {
111111
Local(Importance),
112112

113113
/// No special priority
114+
#[default]
114115
Default,
115116
}
116117

117-
impl Default for Priority {
118-
fn default() -> Self {
119-
Self::Default
120-
}
121-
}
122-
123118
impl Priority {
124119
pub fn is_global(&self) -> bool {
125120
matches!(self, Priority::Global(_))

completion-metadata/src/signature.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn is_long_hand_flag(name: &str) -> bool {
104104
impl Signature {
105105
/// Returns a list of the short-hand flags.
106106
// TODO(alokedesai): Investigate why these are stored in `Vec` instead of precomputed.
107-
pub fn short_hand_flags(&self) -> impl Iterator<Item = AnnotatedFlag> + '_ {
107+
pub fn short_hand_flags(&self) -> impl Iterator<Item = AnnotatedFlag<'_>> + '_ {
108108
self.options
109109
.iter()
110110
.flat_map(|options| options.iter())
@@ -119,7 +119,7 @@ impl Signature {
119119

120120
/// Returns a list of long-hand flags.
121121
// TODO(alokedesai): Investigate why these are stored in `Vec` instead of precomputed.
122-
pub fn long_hand_flags(&self) -> impl Iterator<Item = AnnotatedFlag> + '_ {
122+
pub fn long_hand_flags(&self) -> impl Iterator<Item = AnnotatedFlag<'_>> + '_ {
123123
self.options
124124
.iter()
125125
.flat_map(|options| options.iter())

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[toolchain]
2-
channel = "1.85"
2+
channel = "1.92"
33
components = ["rustfmt", "clippy"]
44
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin"]
55
profile = "minimal"

0 commit comments

Comments
 (0)