aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/archive.rs2
-rw-r--r--src/args.rs4
-rw-r--r--src/listing.rs4
-rw-r--r--src/renderer.rs18
-rw-r--r--src/webdav_fs.rs2
5 files changed, 18 insertions, 12 deletions
diff --git a/src/archive.rs b/src/archive.rs
index da79ef8..f144e35 100644
--- a/src/archive.rs
+++ b/src/archive.rs
@@ -6,7 +6,7 @@ use libflate::gzip::Encoder;
use serde::Deserialize;
use strum::{Display, EnumIter, EnumString};
use tar::Builder;
-use zip::{write, ZipWriter};
+use zip::{ZipWriter, write};
use crate::errors::RuntimeError;
diff --git a/src/args.rs b/src/args.rs
index ee9cb7e..6874e25 100644
--- a/src/args.rs
+++ b/src/args.rs
@@ -394,7 +394,9 @@ fn validate_is_dir_and_exists(s: &str) -> Result<PathBuf, String> {
#[derive(Clone, Debug, thiserror::Error)]
pub enum AuthParseError {
/// Might occur if the HTTP credential string does not respect the expected format
- #[error("Invalid format for credentials string. Expected username:password, username:sha256:hash or username:sha512:hash")]
+ #[error(
+ "Invalid format for credentials string. Expected username:password, username:sha256:hash or username:sha512:hash"
+ )]
InvalidAuthFormat,
/// Might occur if the hash method is neither sha256 nor sha512
diff --git a/src/listing.rs b/src/listing.rs
index d908e23..025ae86 100644
--- a/src/listing.rs
+++ b/src/listing.rs
@@ -4,11 +4,11 @@ use std::path::{Component, Path};
use std::time::SystemTime;
use actix_web::{
- dev::ServiceResponse, http::Uri, web::Query, HttpMessage, HttpRequest, HttpResponse,
+ HttpMessage, HttpRequest, HttpResponse, dev::ServiceResponse, http::Uri, web::Query,
};
use bytesize::ByteSize;
use clap::ValueEnum;
-use comrak::{markdown_to_html, ComrakOptions};
+use comrak::{ComrakOptions, markdown_to_html};
use percent_encoding::{percent_decode_str, utf8_percent_encode};
use regex::Regex;
use serde::Deserialize;
diff --git a/src/renderer.rs b/src/renderer.rs
index 6efc534..a59f458 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -3,19 +3,19 @@ use std::time::SystemTime;
use actix_web::http::{StatusCode, Uri};
use chrono::{DateTime, Local};
use chrono_humanize::Humanize;
-use clap::{crate_name, crate_version, ValueEnum};
+use clap::{ValueEnum, crate_name, crate_version};
use fast_qr::{
- convert::{svg::SvgBuilder, Builder},
- qr::QRCodeError,
QRBuilder,
+ convert::{Builder, svg::SvgBuilder},
+ qr::QRCodeError,
};
-use maud::{html, Markup, PreEscaped, DOCTYPE};
+use maud::{DOCTYPE, Markup, PreEscaped, html};
use strum::{Display, IntoEnumIterator};
use crate::auth::CurrentUser;
use crate::consts;
use crate::listing::{Breadcrumb, Entry, ListingQueryParameters, SortingMethod, SortingOrder};
-use crate::{archive::ArchiveMethod, MiniserveConfig};
+use crate::{MiniserveConfig, archive::ArchiveMethod};
#[allow(clippy::too_many_arguments)]
/// Renders the file listing
@@ -1074,7 +1074,9 @@ mod tests {
Some("Marcell D'Avis"),
)
.into();
- let expected = to_html("-P '1&amp;1 - Willkommen!!!' --ask-password --user 'Marcell D'&quot;'&quot;'Avis' 'http://1und1.de");
+ let expected = to_html(
+ "-P '1&amp;1 - Willkommen!!!' --ask-password --user 'Marcell D'&quot;'&quot;'Avis' 'http://1und1.de",
+ );
assert_eq!(to_be_tested, expected);
}
@@ -1086,7 +1088,9 @@ mod tests {
Some("uøý`¶'7ÅÛé"),
)
.into();
- let expected = to_html("--ask-password --user 'uøý`¶'&quot;'&quot;'7ÅÛé' 'http://127.0.0.1:1234/geheime_dokumente.php");
+ let expected = to_html(
+ "--ask-password --user 'uøý`¶'&quot;'&quot;'7ÅÛé' 'http://127.0.0.1:1234/geheime_dokumente.php",
+ );
assert_eq!(to_be_tested, expected);
}
diff --git a/src/webdav_fs.rs b/src/webdav_fs.rs
index d21a534..c00d9fc 100644
--- a/src/webdav_fs.rs
+++ b/src/webdav_fs.rs
@@ -2,7 +2,7 @@
//! for WebDAV handlers
use dav_server::{davpath::DavPath, fs::*, localfs::LocalFs};
-use futures::{future::ready, StreamExt, TryFutureExt};
+use futures::{StreamExt, TryFutureExt, future::ready};
use std::path::{Component, Path};
/// A dav_server local filesystem backend that can be configured to deny access