aboutsummaryrefslogtreecommitdiffstats
path: root/src/themes.rs
diff options
context:
space:
mode:
authorboastful-squirrel <boastful.squirrel@gmail.com>2019-04-26 18:08:16 +0000
committerboastful-squirrel <boastful.squirrel@gmail.com>2019-04-26 18:08:16 +0000
commit4a9711b71674c6b62512dd6286869690d4497bcc (patch)
treecd2d14e7635a96fdcf23d7a70f2b65bb78f515fe /src/themes.rs
parentMerged query parameter structs + improved file upload errors (diff)
downloadminiserve-4a9711b71674c6b62512dd6286869690d4497bcc.tar.gz
miniserve-4a9711b71674c6b62512dd6286869690d4497bcc.zip
Made ColorScheme, SortingMethod and SortingOrder enums derive Copy
Diffstat (limited to '')
-rw-r--r--src/themes.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/themes.rs b/src/themes.rs
index a7b619e..49a1ad3 100644
--- a/src/themes.rs
+++ b/src/themes.rs
@@ -3,7 +3,7 @@ use structopt::clap::arg_enum;
use strum_macros::EnumIter;
arg_enum! {
- #[derive(PartialEq, Deserialize, Clone, EnumIter)]
+ #[derive(PartialEq, Deserialize, Clone, EnumIter, Copy)]
#[serde(rename_all = "lowercase")]
pub enum ColorScheme {
Archlinux,
@@ -17,8 +17,8 @@ impl ColorScheme {
/// Returns the URL-compatible name of a color scheme
/// This must correspond to the name of the variant, in lowercase
/// See https://github.com/svenstaro/miniserve/pull/55 for explanations
- pub fn to_slug(&self) -> String {
- match &self {
+ pub fn to_slug(self) -> String {
+ match self {
ColorScheme::Archlinux => "archlinux",
ColorScheme::Zenburn => "zenburn",
ColorScheme::Monokai => "monokai",
@@ -28,8 +28,8 @@ impl ColorScheme {
}
/// Returns wether a color scheme is dark
- pub fn is_dark(&self) -> bool {
- match &self {
+ pub fn is_dark(self) -> bool {
+ match self {
ColorScheme::Archlinux => true,
ColorScheme::Zenburn => true,
ColorScheme::Monokai => true,