Browse Source

fix: some typos

close #6
pull/8/head
sigoden 3 years ago
parent
commit
f43d0b646d
  1. 7
      src/args.rs
  2. 3
      src/server.rs

7
src/args.rs

@ -1,7 +1,6 @@ @@ -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> { @@ -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 { @@ -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!(

3
src/server.rs

@ -444,8 +444,7 @@ impl InnerService { @@ -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>>(

Loading…
Cancel
Save