Skip to content

Commit 562cefd

Browse files
committed
Fix clippy warnings for wasm32-wasip1 target
1 parent 0081752 commit 562cefd

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

src/uu/sort/src/merge.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -779,10 +779,10 @@ impl<M: MergeInput> SyncFileMerger<'_, M> {
779779
}
780780

781781
#[cfg(wasi_no_threads)]
782-
fn merge_without_limit_sync<'a, M: MergeInput + 'static, F: Iterator<Item = UResult<M>>>(
782+
fn merge_without_limit_sync<M: MergeInput + 'static, F: Iterator<Item = UResult<M>>>(
783783
files: F,
784-
settings: &'a GlobalSettings,
785-
) -> UResult<SyncFileMerger<'a, M>> {
784+
settings: &GlobalSettings,
785+
) -> UResult<SyncFileMerger<'_, M>> {
786786
let separator = settings.line_ending.into();
787787
let mut readers: Vec<Option<SyncReaderFile<M>>> = Vec::new();
788788
let mut mergeable_files = Vec::new();

src/uu/touch/src/touch.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -807,7 +807,10 @@ fn parse_timestamp(s: &str) -> UResult<FileTime> {
807807
///
808808
/// On Windows, uses `GetFinalPathNameByHandleW` to attempt to get the path
809809
/// from the stdout handle.
810-
#[cfg_attr(not(windows), expect(clippy::unnecessary_wraps))]
810+
#[cfg_attr(
811+
not(any(windows, target_os = "wasi")),
812+
expect(clippy::unnecessary_wraps)
813+
)]
811814
fn pathbuf_from_stdout() -> Result<PathBuf, TouchError> {
812815
#[cfg(all(unix, not(target_os = "android")))]
813816
{
@@ -818,11 +821,9 @@ fn pathbuf_from_stdout() -> Result<PathBuf, TouchError> {
818821
Ok(PathBuf::from("/proc/self/fd/1"))
819822
}
820823
#[cfg(target_os = "wasi")]
821-
{
822-
return Err(TouchError::UnsupportedPlatformFeature(
823-
"touch - (stdout) is not supported on WASI".to_string(),
824-
));
825-
}
824+
return Err(TouchError::UnsupportedPlatformFeature(
825+
"touch - (stdout) is not supported on WASI".to_string(),
826+
));
826827
#[cfg(windows)]
827828
{
828829
use std::os::windows::prelude::AsRawHandle;

src/uucore/src/lib/features/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ impl FileInformation {
188188
#[cfg(windows)]
189189
return self.0.number_of_links();
190190
#[cfg(target_os = "wasi")]
191-
return self.0.st_nlink as u64;
191+
return self.0.st_nlink;
192192
}
193193

194194
#[cfg(unix)]

src/uucore/src/lib/features/fsext.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,6 +458,7 @@ use std::ptr;
458458
use std::slice;
459459

460460
/// Read file system list.
461+
#[cfg_attr(target_os = "wasi", allow(clippy::unnecessary_wraps))]
461462
pub fn read_fs_list() -> UResult<Vec<MountInfo>> {
462463
#[cfg(any(target_os = "linux", target_os = "android", target_os = "cygwin"))]
463464
{

0 commit comments

Comments
 (0)