Skip to content

Commit 4cbc785

Browse files
authored
Merge pull request #2459 from matthiaskrgr/clippy
fix feature-hidden clippy warnings (clippy::len_zero)
2 parents 4ee141e + cb90416 commit 4cbc785

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/cli/self_update/shell.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ struct Bash;
126126

127127
impl UnixShell for Bash {
128128
fn does_exist(&self) -> bool {
129-
self.update_rcs().len() > 0
129+
!self.update_rcs().is_empty()
130130
}
131131

132132
fn rcfiles(&self) -> Vec<PathBuf> {
@@ -155,15 +155,15 @@ impl Zsh {
155155

156156
if matches!(process().var("SHELL"), Ok(sh) if sh.contains("zsh")) {
157157
match process().var("ZDOTDIR") {
158-
Ok(dir) if dir.len() > 0 => Ok(PathBuf::from(dir)),
158+
Ok(dir) if !dir.is_empty() => Ok(PathBuf::from(dir)),
159159
_ => bail!("Zsh setup failed."),
160160
}
161161
} else {
162162
match std::process::Command::new("zsh")
163163
.args(&["-c", "'echo $ZDOTDIR'"])
164164
.output()
165165
{
166-
Ok(io) if io.stdout.len() > 0 => Ok(PathBuf::from(OsStr::from_bytes(&io.stdout))),
166+
Ok(io) if !io.stdout.is_empty() => Ok(PathBuf::from(OsStr::from_bytes(&io.stdout))),
167167
_ => bail!("Zsh setup failed."),
168168
}
169169
}

0 commit comments

Comments
 (0)