]> OzVa Git service - ozva-cloud/commitdiff
fix: some typos
authorsigoden <sigoden@gmail.com>
Tue, 31 May 2022 14:38:00 +0000 (22:38 +0800)
committersigoden <sigoden@gmail.com>
Tue, 31 May 2022 14:38:00 +0000 (22:38 +0800)
close #6

src/args.rs
src/server.rs

index 089c959b46ef2f2be0e25eec0172b7f49a207c9e..f4714df6f21a82cbf5cba0ec4a15e8d4b19e7528 100644 (file)
@@ -1,7 +1,6 @@
 use clap::crate_description;
 use clap::{Arg, ArgMatches};
 use std::env;
-use std::fs::canonicalize;
 use std::net::SocketAddr;
 use std::path::{Path, PathBuf};
 
@@ -47,12 +46,12 @@ fn app() -> clap::Command<'static> {
         )
         .arg(
             Arg::new("allow-delete")
-                .long("allo-delete")
+                .long("allow-delete")
                 .help("Allow delete operation"),
         )
         .arg(
             Arg::new("allow-symlink")
-                .long("allo-symlink")
+                .long("allow-symlink")
                 .help("Allow symlink to directories/files outside root directory"),
         )
         .arg(
@@ -130,7 +129,7 @@ impl Args {
         env::current_dir()
             .and_then(|mut p| {
                 p.push(path); // If path is absolute, it replaces the current path.
-                canonicalize(p)
+                std::fs::canonicalize(p)
             })
             .or_else(|err| {
                 bail!(
index d304aef7308facb4e854546ace61aee20917a92a..f6f6a02830331fec672a39997b1e26cef86ad664 100644 (file)
@@ -444,8 +444,7 @@ impl InnerService {
         } else {
             decoded_path.into_owned()
         };
-        let fullpath = self.args.path.join(&slashes_switched);
-        Some(fullpath)
+        Some(self.args.path.join(&slashes_switched))
     }
 
     async fn to_pathitem<P: AsRef<Path>>(