From a73a74283f64986ff6a0b6da4c234a828bc52522 Mon Sep 17 00:00:00 2001 From: boastful-squirrel Date: Fri, 3 May 2019 19:32:51 +0200 Subject: Return QueryParameters struct instead of tuple --- src/main.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 07827c0..bcfda09 100644 --- a/src/main.rs +++ b/src/main.rs @@ -83,7 +83,9 @@ fn run() -> Result<(), ContextualError> { && miniserve_config .path .symlink_metadata() - .map_err(|e| ContextualError::IOError("Failed to retrieve symlink's metadata".to_string(), e))? + .map_err(|e| { + ContextualError::IOError("Failed to retrieve symlink's metadata".to_string(), e) + })? .file_type() .is_symlink() { @@ -285,8 +287,8 @@ fn error_404(req: &HttpRequest) -> Result "/".to_string(), }; - let (sort_method, sort_order, _, color_scheme, _) = listing::extract_query_parameters(req); - let color_scheme = color_scheme.unwrap_or(default_color_scheme); + let query_params = listing::extract_query_parameters(req); + let color_scheme = query_params.theme.unwrap_or(default_color_scheme); errors::log_error_chain(err_404.to_string()); @@ -295,8 +297,8 @@ fn error_404(req: &HttpRequest) -> Result