diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/args.rs | 2 | ||||
-rw-r--r-- | src/listing.rs | 15 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/args.rs b/src/args.rs index bf16291..8893ebd 100644 --- a/src/args.rs +++ b/src/args.rs @@ -1,7 +1,7 @@ +use port_check::free_local_port; use std::net::{IpAddr, Ipv4Addr, Ipv6Addr}; use std::path::PathBuf; use structopt::StructOpt; -use port_check::free_local_port; use crate::auth; use crate::errors::ContextualError; diff --git a/src/listing.rs b/src/listing.rs index 6181c3a..063fbf3 100644 --- a/src/listing.rs +++ b/src/listing.rs @@ -4,12 +4,12 @@ use bytesize::ByteSize; use futures::Stream; use htmlescape::encode_minimal as escape_html_entity; use percent_encoding::{utf8_percent_encode, AsciiSet, CONTROLS}; +use qrcodegen::{QrCode, QrCodeEcc}; use serde::Deserialize; use std::io; use std::path::{Path, PathBuf}; use std::time::SystemTime; use strum_macros::{Display, EnumString}; -use qrcodegen::{QrCode, QrCodeEcc}; use crate::archive::CompressionMethod; use crate::errors::{self, ContextualError}; @@ -169,18 +169,15 @@ pub fn directory_listing<S>( // If the `qrcode` parameter is included in the url, then should respond to the QR code if let Some(url) = query_params.qrcode { let res = match QrCode::encode_text(&url, QrCodeEcc::Medium) { - Ok(qr) => { - HttpResponse::Ok() - .header("Content-Type", "image/svg+xml") - .body(qr.to_svg_string(2)) - }, + Ok(qr) => HttpResponse::Ok() + .header("Content-Type", "image/svg+xml") + .body(qr.to_svg_string(2)), Err(err) => { log::error!("URL is too long: {:?}", err); - HttpResponse::UriTooLong() - .body(Body::Empty) + HttpResponse::UriTooLong().body(Body::Empty) } }; - return Ok(res) + return Ok(res); } let mut entries: Vec<Entry> = Vec::new(); |