Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
AnActualEmerald committed Feb 3, 2024
1 parent 5251bd1 commit f71f0ea
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/core/commands/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,14 @@ pub fn list(global: bool, _all: bool) -> Result<()> {
if !std::io::stdout().is_terminal() {
let out = std::io::stdout();
for (group, name) in grouped_mods {
if let Err(e) = write!(out.lock(), "{}\n", group.name) {
if let Err(e) = writeln!(out.lock(), "{}", group.name) {
if e.kind() != ErrorKind::BrokenPipe {
return Err(e.into());
}
}

for n in name {
if let Err(e) = write!(out.lock(), "{n}\n") {
if let Err(e) = writeln!(out.lock(), "{n}") {
if e.kind() != ErrorKind::BrokenPipe {
return Err(e.into());
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/commands/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ fn activate_profile(name: &String) -> Result<()> {
return init_msg();
};

if CONFIG.is_ignored(&name) {
if CONFIG.is_ignored(name) {
println!(
"Directory {} is on the ignore list. Please run '{}' and try again.",
name.bright_red(),
Expand Down Expand Up @@ -129,7 +129,7 @@ fn list_profiles() -> Result<()> {
let out = std::io::stdout();
for p in profiles {
if let Some(name) = p.file_name().and_then(|os| os.to_str()) {
if let Err(e) = write!(out.lock(), "{name}\n") {
if let Err(e) = writeln!(out.lock(), "{name}") {
if e.kind() != ErrorKind::BrokenPipe {
return Err(e.into());
}
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ fn main() -> ExitCode {

let res = match cli.command {
Commands::Complete { shell } => {
if let Some(shell) = shell.or_else(|| Shell::from_env()) {
if let Some(shell) = shell.or_else(Shell::from_env) {
let mut cmd = Cli::command();
let out = std::io::stdout();
generate(shell, &mut cmd, "papa", &mut out.lock());
Expand Down

0 comments on commit f71f0ea

Please sign in to comment.