aboutsummaryrefslogtreecommitdiffstats
path: root/src/renderer.rs
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2021-04-18 03:49:52 +0000
committerSven-Hendrik Haase <svenstaro@gmail.com>2021-04-18 03:49:52 +0000
commit08f6bc54dac113995fb5e3c138bdc50e2ae75905 (patch)
tree74a075b5c0c8184a1373288b9d7e6bcb046ab528 /src/renderer.rs
parentUpdate README for separate .tar and .tar.gz flags (diff)
downloadminiserve-08f6bc54dac113995fb5e3c138bdc50e2ae75905.tar.gz
miniserve-08f6bc54dac113995fb5e3c138bdc50e2ae75905.zip
Rename compression code references to 'archive'
This name more closely resembles its purpose. For instance, we also now support plain tar archives which are uncompressed but archives nonetheless.
Diffstat (limited to 'src/renderer.rs')
-rw-r--r--src/renderer.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/renderer.rs b/src/renderer.rs
index 4596369..fc6897c 100644
--- a/src/renderer.rs
+++ b/src/renderer.rs
@@ -6,7 +6,7 @@ use std::time::SystemTime;
use structopt::clap::{crate_name, crate_version};
use strum::IntoEnumIterator;
-use crate::archive::CompressionMethod;
+use crate::archive::ArchiveMethod;
use crate::listing::{Breadcrumb, Entry, SortingMethod, SortingOrder};
/// Renders the file listing
@@ -97,9 +97,9 @@ pub fn page(
div.toolbar {
@if tar_enabled || tar_gz_enabled || zip_enabled {
div.download {
- @for compression_method in CompressionMethod::iter() {
- @if compression_method.is_enabled(tar_enabled, tar_gz_enabled, zip_enabled) {
- (archive_button(compression_method, sort_method, sort_order))
+ @for archive_method in ArchiveMethod::iter() {
+ @if archive_method.is_enabled(tar_enabled, tar_gz_enabled, zip_enabled) {
+ (archive_button(archive_method, sort_method, sort_order))
}
}
}
@@ -230,21 +230,21 @@ fn color_scheme_link(color_scheme: &(&str, &str)) -> Markup {
/// Partial: archive button
fn archive_button(
- compress_method: CompressionMethod,
+ archive_method: ArchiveMethod,
sort_method: Option<SortingMethod>,
sort_order: Option<SortingOrder>,
) -> Markup {
let link = if sort_method.is_none() && sort_order.is_none() {
- format!("?download={}", compress_method)
+ format!("?download={}", archive_method)
} else {
format!(
"{}&download={}",
parametrized_link("", sort_method, sort_order,),
- compress_method
+ archive_method
)
};
- let text = format!("Download .{}", compress_method.extension());
+ let text = format!("Download .{}", archive_method.extension());
html! {
a href=(link) {