Skip to content

Commit f41a088

Browse files
authored
sort: fix warnings about unused stuff on Redox (#11547)
1 parent aab0dda commit f41a088

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/uu/sort/src/tmp_dir.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,21 @@
22
//
33
// For the full copyright and license information, please view the LICENSE
44
// file that was distributed with this source code.
5+
6+
#[cfg(not(target_os = "redox"))]
7+
use std::path::Path;
8+
#[cfg(not(target_os = "redox"))]
59
use std::sync::atomic::{AtomicBool, Ordering};
610
use std::{
711
fs::File,
8-
path::{Path, PathBuf},
12+
path::PathBuf,
913
sync::{Arc, LazyLock, Mutex},
1014
};
1115

1216
use tempfile::TempDir;
13-
use uucore::{
14-
error::{UResult, USimpleError},
15-
show_error, translate,
16-
};
17+
use uucore::error::UResult;
18+
#[cfg(not(target_os = "redox"))]
19+
use uucore::{error::USimpleError, show_error, translate};
1720

1821
use crate::{SortError, current_open_fd_count, fd_soft_limit};
1922

@@ -181,6 +184,7 @@ impl Drop for TmpDirWrapper {
181184

182185
/// Remove the directory at `path` by deleting its child files and then itself.
183186
/// Errors while deleting child files are ignored.
187+
#[cfg(not(target_os = "redox"))]
184188
fn remove_tmp_dir(path: &Path) -> std::io::Result<()> {
185189
if let Ok(read_dir) = std::fs::read_dir(path) {
186190
for file in read_dir.flatten() {

0 commit comments

Comments
 (0)