aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorcyqsimon <28627918+cyqsimon@users.noreply.github.com>2022-09-15 18:56:02 +0000
committerGitHub <noreply@github.com>2022-09-15 18:56:02 +0000
commit82a3207671e3a01eb011129e1f34b653ca7eb39c (patch)
treedf7667ba5db89c496db7a26e2628f32e56f17f65 /src
parentAdd tooltip on QR code (diff)
parentMerge pull request #902 from kianmeng/fix-typos (diff)
downloadminiserve-82a3207671e3a01eb011129e1f34b653ca7eb39c.tar.gz
miniserve-82a3207671e3a01eb011129e1f34b653ca7eb39c.zip
Merge branch 'master' into qrcode
Diffstat (limited to 'src')
-rw-r--r--src/archive.rs2
-rw-r--r--src/args.rs2
-rw-r--r--src/listing.rs4
-rw-r--r--src/main.rs5
-rw-r--r--src/renderer.rs8
5 files changed, 11 insertions, 10 deletions
diff --git a/src/archive.rs b/src/archive.rs
index 29f60c1..940d4b6 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -250,7 +250,7 @@ where
continue;
}
let current_entry_name = entry_path.file_name().ok_or_else(|| {
- ContextualError::InvalidPathError("Invalid file or direcotory name".to_string())
+ ContextualError::InvalidPathError("Invalid file or directory name".to_string())
})?;
if entry_metadata.is_file() {
let mut f = File::open(&entry_path)
diff --git a/src/args.rs b/src/args.rs
index a769256..a8718bd 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -203,7 +203,7 @@ pub struct CliArgs {
pub readme: bool,
}
-/// Checks wether an interface is valid, i.e. it can be parsed into an IP address
+/// Checks whether an interface is valid, i.e. it can be parsed into an IP address
fn parse_interface(src: &str) -> Result<IpAddr, std::net::AddrParseError> {
src.parse::<IpAddr>()
}
diff --git a/src/listing.rs b/src/listing.rs
index c0104b1..7477599 100644
--- a/src/listing.rs
+++ b/src/listing.rs
@@ -119,12 +119,12 @@ impl Entry {
}
}
- /// Returns wether the entry is a directory
+ /// Returns whether the entry is a directory
pub fn is_dir(&self) -> bool {
self.entry_type == EntryType::Directory
}
- /// Returns wether the entry is a file
+ /// Returns whether the entry is a file
pub fn is_file(&self) -> bool {
self.entry_type == EntryType::File
}
diff --git a/src/main.rs b/src/main.rs
index 11193cc..b49089b 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -11,7 +11,6 @@ use actix_web::{middleware, App, HttpRequest, HttpResponse};
use actix_web_httpauth::middleware::HttpAuthentication;
use anyhow::Result;
use clap::{crate_version, IntoApp, Parser};
-use clap_complete::generate;
use fast_qr::QRBuilder;
use log::{error, warn};
use yansi::{Color, Paint};
@@ -36,7 +35,7 @@ fn main() -> Result<()> {
if let Some(shell) = args.print_completions {
let mut clap_app = args::CliArgs::command();
let app_name = clap_app.get_name().to_string();
- generate(shell, &mut clap_app, app_name, &mut io::stdout());
+ clap_complete::generate(shell, &mut clap_app, app_name, &mut io::stdout());
return Ok(());
}
@@ -300,7 +299,7 @@ fn configure_app(app: &mut web::ServiceConfig, conf: &MiniserveConfig) {
if conf.spa {
files = files.default_handler(
NamedFile::open(&conf.path.join(index_file))
- .expect("Cant open SPA index file."),
+ .expect("Can't open SPA index file."),
);
}
}
diff --git a/src/renderer.rs b/src/renderer.rs
index ebb9f6f..c8958fe 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -172,9 +172,11 @@ pub fn page(
}
}
@if let Some(readme) = readme {
- div {
- h3 { (readme.0) }
- (PreEscaped (readme.1));
+ div id="readme" {
+ h3 id="readme-filename" { (readme.0) }
+ div id="readme-contents" {
+ (PreEscaped (readme.1))
+ };
}
}
a.back href="#top" {