From 08f6bc54dac113995fb5e3c138bdc50e2ae75905 Mon Sep 17 00:00:00 2001 From: Sven-Hendrik Haase Date: Sun, 18 Apr 2021 05:49:52 +0200 Subject: 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. --- src/renderer.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/renderer.rs') 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, sort_order: Option, ) -> 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) { -- cgit v1.2.3