pub fn uu_app() -> Commanddiff --git a/dev/src/uu_pwd/pwd.rs.html b/dev/src/uu_pwd/pwd.rs.html index d781dbdd4..043934dfb 100644 --- a/dev/src/uu_pwd/pwd.rs.html +++ b/dev/src/uu_pwd/pwd.rs.html @@ -160,20 +160,6 @@ 160 161 162 -163 -164 -165 -166 -167 -168 -169 -170 -171 -172 -173 -174 -175 -176
// * This file is part of the uutils coreutils package.
// *
// * (c) Derek Chiang <derekchiang93@gmail.com>
@@ -191,10 +177,10 @@
use uucore::display::println_verbatim;
use uucore::error::{FromIo, UResult};
-static ABOUT: &str = help_about!("pwd.md");
+const ABOUT: &str = help_about!("pwd.md");
const USAGE: &str = help_usage!("pwd.md");
-static OPT_LOGICAL: &str = "logical";
-static OPT_PHYSICAL: &str = "physical";
+const OPT_LOGICAL: &str = "logical";
+const OPT_PHYSICAL: &str = "physical";
fn physical_path() -> io::Result<PathBuf> {
// std::env::current_dir() is a thin wrapper around libc::getcwd().
@@ -260,37 +246,23 @@
{
use std::fs::metadata;
use std::os::unix::fs::MetadataExt;
- let path_info = match metadata(path) {
- Ok(info) => info,
- Err(_) => return false,
- };
- let real_info = match metadata(".") {
- Ok(info) => info,
- Err(_) => return false,
- };
- if path_info.dev() != real_info.dev() || path_info.ino() != real_info.ino() {
- return false;
+ match (metadata(path), metadata(".")) {
+ (Ok(info1), Ok(info2)) => {
+ info1.dev() == info2.dev() && info1.ino() == info2.ino()
+ }
+ _ => false,
}
}
#[cfg(not(unix))]
{
use std::fs::canonicalize;
- let canon_path = match canonicalize(path) {
- Ok(path) => path,
- Err(_) => return false,
- };
- let real_path = match canonicalize(".") {
- Ok(path) => path,
- Err(_) => return false,
- };
- if canon_path != real_path {
- return false;
+ match (canonicalize(path), canonicalize(".")) {
+ (Ok(path1), Ok(path2)) => path1 == path2,
+ _ => false,
}
}
-
- true
- }
+ }
match env::var_os("PWD").map(PathBuf::from) {
Some(value) if looks_reasonable(&value) => Ok(value),
diff --git a/dev/uu_pwd/fn.uu_app.html b/dev/uu_pwd/fn.uu_app.html
index b3cbbcbbf..493a81407 100644
--- a/dev/uu_pwd/fn.uu_app.html
+++ b/dev/uu_pwd/fn.uu_app.html
@@ -1 +1 @@
-uu_app in uu_pwd - Rust
\ No newline at end of file
+uu_app in uu_pwd - Rust
\ No newline at end of file
diff --git a/dev/uu_pwd/fn.uumain.html b/dev/uu_pwd/fn.uumain.html
index d343ab87d..97739e297 100644
--- a/dev/uu_pwd/fn.uumain.html
+++ b/dev/uu_pwd/fn.uumain.html
@@ -1 +1 @@
-uumain in uu_pwd - Rust
\ No newline at end of file
+uumain in uu_pwd - Rust
\ No newline at end of file
diff --git a/dev/uu_pwd/index.html b/dev/uu_pwd/index.html
index c6816f32f..daf767328 100644
--- a/dev/uu_pwd/index.html
+++ b/dev/uu_pwd/index.html
@@ -1 +1 @@
-uu_pwd - Rust
\ No newline at end of file
+uu_pwd - Rust
\ No newline at end of file