From 05759a8592c0dd231e4396ed3c53077574bd1898 Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Tue, 5 May 2026 22:11:22 +0200 Subject: [PATCH] yes: move import to the other imports (#12153) --- src/uu/yes/src/yes.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/uu/yes/src/yes.rs b/src/uu/yes/src/yes.rs index e3e78d9ba..46f6b2ddb 100644 --- a/src/uu/yes/src/yes.rs +++ b/src/uu/yes/src/yes.rs @@ -9,14 +9,13 @@ use clap::{Arg, ArgAction, Command, builder::ValueParser}; use std::ffi::OsString; use std::io::{self, Write}; use uucore::error::{UResult, USimpleError, strip_errno}; -use uucore::format_usage; -use uucore::translate; +#[cfg(any(target_os = "linux", target_os = "android"))] +use uucore::pipes::MAX_ROOTLESS_PIPE_SIZE; +use uucore::{format_usage, translate}; #[cfg(any(target_os = "linux", target_os = "android"))] const PAGE_SIZE: usize = 4096; #[cfg(any(target_os = "linux", target_os = "android"))] -use uucore::pipes::MAX_ROOTLESS_PIPE_SIZE; -#[cfg(any(target_os = "linux", target_os = "android"))] const BUF_SIZE: usize = MAX_ROOTLESS_PIPE_SIZE; // it's possible that using a smaller or larger buffer might provide better performance #[cfg(not(any(target_os = "linux", target_os = "android")))] @@ -116,6 +115,7 @@ pub fn exec(mut bytes: Vec) -> io::Result<()> { #[cfg(any(target_os = "linux", target_os = "android"))] pub fn exec(mut bytes: Vec) -> io::Result<()> { use uucore::pipes::{pipe, splice, tee}; + let aligned = PAGE_SIZE.is_multiple_of(bytes.len()); repeat_content_to_capacity(&mut bytes); let bytes = bytes.as_slice();