From e2a0e1652e0477ff0bd4454f2013b30221a7f431 Mon Sep 17 00:00:00 2001 From: Johannes Altmanninger Date: Tue, 5 Dec 2023 08:44:51 +0100 Subject: [PATCH] Clean up some std::io calls --- fish-rust/src/path.rs | 4 ++-- fish-rust/src/proc.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/fish-rust/src/path.rs b/fish-rust/src/path.rs index 5ccb999f4..4877a975c 100644 --- a/fish-rust/src/path.rs +++ b/fish-rust/src/path.rs @@ -14,7 +14,7 @@ use errno::{errno, set_errno, Errno}; use libc::{EACCES, ENOENT, ENOTDIR, F_OK, X_OK}; use once_cell::sync::Lazy; use std::ffi::OsStr; -use std::io::{ErrorKind, Write}; +use std::io::ErrorKind; use std::os::unix::prelude::*; /// Returns the user configuration directory for fish. If the directory or one of its parents @@ -169,7 +169,7 @@ fn maybe_issue_path_warning( ) ); } - let _ = std::io::stdout().write(&[b'\n']); + printf!("\n"); } /// Finds the path of an executable named \p cmd, by looking in $PATH taken from \p vars. diff --git a/fish-rust/src/proc.rs b/fish-rust/src/proc.rs index e9a996fc6..f623b7e0e 100644 --- a/fish-rust/src/proc.rs +++ b/fish-rust/src/proc.rs @@ -1772,7 +1772,7 @@ fn process_clean_after_marking(parser: &Parser, allow_interactive: bool) -> bool } if printed { - let _ = std::io::stdout().lock().flush(); + let _ = std::io::stdout().flush(); } printed