+
Skip to content

Update to uucore 0.0.29 #486

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 22 additions & 33 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ walkdir = "2.5"
regex = "1.11"
once_cell = "1.20"
onig = { version = "6.4", default-features = false }
uucore = { version = "0.0.27", features = ["entries", "fs", "fsext", "mode"] }
uucore = { version = "0.0.29", features = ["entries", "fs", "fsext", "mode"] }
nix = { version = "0.29", features = ["fs", "user"] }

[dev-dependencies]
Expand Down
12 changes: 3 additions & 9 deletions src/find/matchers/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
use super::{Matcher, MatcherIO, WalkEntry};
use uucore::error::UResult;

/// The latest mapping from dev_id to fs_type, used for saving mount info reads
#[cfg(unix)]
Expand All @@ -26,15 +27,11 @@ pub struct Cache {
#[cfg(unix)]
use std::{
cell::RefCell,
error::Error,
io::{stderr, Write},
path::Path,
};
#[cfg(unix)]
pub fn get_file_system_type(
path: &Path,
cache: &RefCell<Option<Cache>>,
) -> Result<String, Box<dyn Error>> {
pub fn get_file_system_type(path: &Path, cache: &RefCell<Option<Cache>>) -> UResult<String> {
use std::os::unix::fs::MetadataExt;

// use symlink_metadata (lstat under the hood) instead of metadata (stat) to make sure that it
Expand All @@ -51,10 +48,7 @@ pub fn get_file_system_type(
}
}

let fs_list = match uucore::fsext::read_fs_list() {
Ok(fs_list) => fs_list,
Err(err) => Err(err)?,
};
let fs_list = uucore::fsext::read_fs_list()?;
let result = fs_list
.into_iter()
.find(|fs| fs.dev_id == dev_id)
Expand Down
Loading
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载