From c7c723367580bd3a10f7aafed4a7b2784d937135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20=C3=96rn=20Sigur=C3=B0sson?= Date: Sun, 13 Feb 2022 19:43:17 +0000 Subject: [PATCH 1/3] Upgrade clap v2 -> v3 --- Cargo.lock | 267 +++++++++++++++++++++++++++++++++------------------- Cargo.toml | 16 ++-- src/main.rs | 99 ++++++++----------- 3 files changed, 215 insertions(+), 167 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad9cf46..dd3aadd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "aho-corasick" version = "0.7.18" @@ -9,15 +11,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ansi_term" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" -dependencies = [ - "winapi", -] - [[package]] name = "ansi_term" version = "0.12.1" @@ -29,20 +22,26 @@ dependencies = [ [[package]] name = "atty" -version = "0.2.11" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ + "hermit-abi", "libc", - "termion", "winapi", ] +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + [[package]] name = "bitflags" -version = "1.0.3" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c54bb8f454c567f21197eefcdbf5679d0bd99f2ddbe52e84c77061952e6789" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "cfg-if" @@ -65,24 +64,39 @@ dependencies = [ [[package]] name = "clap" -version = "2.33.3" +version = "3.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "b63edc3f163b3c71ec8aa23f9bd6070f77edbf3d1d198b164afa90ff00e4ec62" dependencies = [ - "ansi_term 0.11.0", "atty", "bitflags", + "clap_derive", + "indexmap", + "lazy_static", + "os_str_bytes", "strsim", - "textwrap 0.11.0", - "unicode-width", - "vec_map", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_derive" +version = "3.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a1132dc3944b31c20dd8b906b3a9f0a5d0243e092d59171414969657ac6aa85" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", ] [[package]] name = "ctor" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e98e2ad1a782e33928b96fc3948e7c355e5af34ba4de7670fe8bac2a3b2006d" +checksum = "ccc0a48a9b826acdf4028595adc9db92caea352f7af011a3034acd172a52a0aa" dependencies = [ "quote", "syn", @@ -96,30 +110,67 @@ checksum = "0e25ea47919b1560c4e3b7fe0aaab9becf5b84a10325ddf7db0f0ba5e1026499" [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if", "libc", "wasi", ] +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" + +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "indexmap" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +dependencies = [ + "autocfg", + "hashbrown", +] + [[package]] name = "itoa" -version = "0.4.3" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" + +[[package]] +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.97" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b8adadd720df158f4d70dfe7ccc6adb0472d7c55ca83445f6a5ab3e36f8fb6" +checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" [[package]] name = "litime" -version = "0.5.0" +version = "0.6.0" dependencies = [ "chrono", "clap", @@ -129,71 +180,108 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "textwrap 0.14.0", + "textwrap", ] [[package]] name = "memchr" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "num-integer" -version = "0.1.39" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" +checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ + "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.5" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630de1ef5cc79d0cdd78b7e33b81f083cbfe90de0f4b2b2f07f905867c70e9fe" +checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +dependencies = [ + "autocfg", +] + +[[package]] +name = "os_str_bytes" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e22443d1643a904602595ba1cd8f7d896afe56d26712531c5ff73a15b2fbf64" +dependencies = [ + "memchr", +] [[package]] name = "output_vt100" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53cdc5b785b7a58c5aad8216b3dfa114df64b0b06ae6e1501cef91df2fbdf8f9" +checksum = "628223faebab4e3e40667ee0b2336d34a5b960ff60ea743ddfdbcf7770bcfb66" dependencies = [ "winapi", ] [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" [[package]] name = "pretty_assertions" -version = "0.7.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cab0e7c02cf376875e9335e0ba1da535775beb5450d21e1dffca068818ed98b" +checksum = "76d5b548b725018ab5496482b45cb8bef21e9fed1858a6d674e3a8a0f0bb5d50" dependencies = [ - "ansi_term 0.12.1", + "ansi_term", "ctor", "diff", "output_vt100", ] +[[package]] +name = "proc-macro-error" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" +dependencies = [ + "proc-macro-error-attr", + "proc-macro2", + "quote", + "syn", + "version_check", +] + +[[package]] +name = "proc-macro-error-attr" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" +dependencies = [ + "proc-macro2", + "quote", + "version_check", +] + [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2", ] @@ -238,21 +326,6 @@ dependencies = [ "rand_core", ] -[[package]] -name = "redox_syscall" -version = "0.1.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c214e91d3ecf43e9a4e41e578973adeb14b474f2bee858742d127af75a0112b1" - -[[package]] -name = "redox_termios" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -dependencies = [ - "redox_syscall", -] - [[package]] name = "regex" version = "1.5.4" @@ -272,21 +345,21 @@ checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "serde" -version = "1.0.126" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -295,9 +368,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa", "ryu", @@ -312,15 +385,15 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "strsim" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "syn" -version = "1.0.73" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", @@ -328,30 +401,19 @@ dependencies = [ ] [[package]] -name = "termion" -version = "1.5.1" +name = "termcolor" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" +checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" dependencies = [ - "libc", - "redox_syscall", - "redox_termios", + "winapi-util", ] [[package]] name = "textwrap" -version = "0.11.0" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - -[[package]] -name = "textwrap" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f59f5365546b8424b0cc48868ae4fbbbc29a538dcc496b53543525201034f0c2" +checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" dependencies = [ "smawk", "unicode-linebreak", @@ -371,18 +433,18 @@ dependencies = [ [[package]] name = "unicode-linebreak" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05a31f45d18a3213b918019f78fe6a73a14ab896807f0aaf5622aa0684749455" +checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" dependencies = [ "regex", ] [[package]] name = "unicode-width" -version = "0.1.5" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" @@ -391,10 +453,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] -name = "vec_map" -version = "0.8.1" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" @@ -418,6 +480,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index 3897ebe..937c13f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "litime" -version = "0.5.0" -authors = ["Axel Örn Sigurðsson "] +version = "0.6.0" +authors = ["Axel "] description = "A command line tool to display the current time ish with a literature quote" repository = "https://github.com/ikornaselur/litime" license = "CC-BY-NC-SA-2.5" @@ -9,17 +9,17 @@ readme = "readme.md" edition = "2018" [dependencies] -textwrap = "0.14.0" +textwrap = "0.14.2" rand = "0.8.4" chrono = "0.4.19" -clap = "2.33.3" +clap = { version = "3.0.14", features = ["derive"] } regex = "1.5.4" -serde = "1.0.126" -serde_json = "1.0.64" -serde_derive = "1.0.126" +serde = "1.0.132" +serde_json = "1.0.73" +serde_derive = "1.0.132" [profile.release] lto = true [dev-dependencies] -pretty_assertions = "0.7.2" +pretty_assertions = "1.0.0" diff --git a/src/main.rs b/src/main.rs index 189d9bf..0c23698 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,9 @@ -#[macro_use] extern crate clap; #[macro_use] extern crate serde_derive; use chrono::prelude::*; -use clap::{App, AppSettings, Arg}; +use clap::Parser; use regex::Regex; use crate::minute::get_minute; @@ -17,55 +16,32 @@ static DEFAULT_MAIN: &str = "bright-black"; static DEFAULT_TIME: &str = "red"; static DEFAULT_AUTHOR: &str = "white"; +#[derive(Parser, Debug)] +#[clap(version, about)] +struct Args { + /// A timestamp to get a quote for, for example 07:16 + #[clap(validator = is_timestamp)] + time: Option, + + /// Colour of the quote, excluding the time + #[clap(short, long, validator = is_colour, default_value_t = DEFAULT_MAIN.to_string())] + main_colour: String, + + /// Colour of the time part of the quote + #[clap(short, long, validator = is_colour, default_value_t = DEFAULT_TIME.to_string())] + time_colour: String, + + /// Colour of the author and book below the quote + #[clap(short, long, validator = is_colour, default_value_t = DEFAULT_AUTHOR.to_string())] + author_colour: String, + + /// The max width of the quote + #[clap(short, long, default_value_t = 80)] + width: usize, +} + fn main() { - let matches = App::new("Litime") - .version(crate_version!()) - .setting(AppSettings::ColoredHelp) - .about("Display a timestamp with a literature quote. By default, the current time stamp is used.") - .arg(Arg::with_name("time") - .short("t") - .long("time") - .value_name("time") - .help("A timestamp to get a quote for, for example 07:16.") - .validator(is_timestamp) - .takes_value(true), - ) - .arg(Arg::with_name("width") - .short("w") - .long("width") - .value_name("width") - .help("The max width of the quote") - .default_value("80") - .takes_value(true), - ) - .arg(Arg::with_name("main_colour") - .short("M") - .long("main-colour") - .value_name("main_colour") - .help("Colour of the quote, excluding the time.") - .default_value(DEFAULT_MAIN) - .validator(is_colour) - .takes_value(true), - ) - .arg(Arg::with_name("time_colour") - .short("T") - .long("time-colour") - .value_name("time_colour") - .help("Colour of the time part of the quote.") - .default_value(DEFAULT_TIME) - .validator(is_colour) - .takes_value(true), - ) - .arg(Arg::with_name("author_colour") - .short("A") - .long("author-colour") - .value_name("author_colour") - .help("Colour of the author and book below the quote.") - .default_value(DEFAULT_AUTHOR) - .validator(is_colour) - .takes_value(true), - ) - .get_matches(); + let args = Args::parse(); let local: DateTime = Local::now(); let now = format!( @@ -75,22 +51,23 @@ fn main() { width = 2 ); - let timestamp = matches.value_of("time").unwrap_or(&now); - let width = value_t!(matches, "width", usize).unwrap_or_else(|e| e.exit()); - let main_colour = matches.value_of("main_colour").unwrap_or(DEFAULT_MAIN); - let time_colour = matches.value_of("time_colour").unwrap_or(DEFAULT_TIME); - let author_colour = matches.value_of("author_colour").unwrap_or(DEFAULT_AUTHOR); + let timestamp = args.time.unwrap_or(now); + let minute = get_minute(×tamp); - let minute = get_minute(timestamp); print!( "{}", - minute.formatted(width, main_colour, time_colour, author_colour) + minute.formatted( + args.width, + &args.main_colour, + &args.time_colour, + &args.author_colour + ) ); } -fn is_timestamp(val: String) -> Result<(), String> { +fn is_timestamp(val: &str) -> Result<(), String> { let re = Regex::new(r"^([01][0-9]|2[0-3]):[0-5][0-9]$").unwrap(); - if re.is_match(&val) { + if re.is_match(val) { Ok(()) } else { Err(String::from( @@ -99,9 +76,9 @@ fn is_timestamp(val: String) -> Result<(), String> { } } -fn is_colour(val: String) -> Result<(), String> { +fn is_colour(val: &str) -> Result<(), String> { let re = Regex::new(r"^(bright-)?(black|red|green|yellow|blue|magenta|cyan|white)$").unwrap(); - if re.is_match(&val) { + if re.is_match(val) { Ok(()) } else { Err(format!("Unknown colour.\n{}", COLOUR_HELP)) From 8d2b44b3b944dc5886580e527c4af10a15d96f76 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20=C3=96rn=20Sigur=C3=B0sson?= Date: Sun, 13 Feb 2022 19:45:01 +0000 Subject: [PATCH 2/3] Update other dependencies in cargo.toml --- Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 937c13f..423c02d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,9 +14,9 @@ rand = "0.8.4" chrono = "0.4.19" clap = { version = "3.0.14", features = ["derive"] } regex = "1.5.4" -serde = "1.0.132" -serde_json = "1.0.73" -serde_derive = "1.0.132" +serde = "1.0.136" +serde_json = "1.0.79" +serde_derive = "1.0.136" [profile.release] lto = true From 5ea0975e32f9f3a5000b1578b1922026ee1f7d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20=C3=96rn=20Sigur=C3=B0sson?= Date: Sun, 13 Feb 2022 19:49:26 +0000 Subject: [PATCH 3/3] Lint --- src/minute.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/minute.rs b/src/minute.rs index b11a1b1..43db109 100644 --- a/src/minute.rs +++ b/src/minute.rs @@ -13,7 +13,7 @@ pub struct Minute { const RAW_TIMES: &str = include_str!("times.json"); pub fn get_minute(time: &str) -> Minute { - let minutes: HashMap<&str, Vec> = serde_json::from_str(&RAW_TIMES).unwrap(); + let minutes: HashMap<&str, Vec> = serde_json::from_str(RAW_TIMES).unwrap(); let minute = minutes .get(time)