From 5292d619ee363cde5f66a455c65b3ae5c0a17df0 Mon Sep 17 00:00:00 2001 From: cscherr Date: Wed, 16 Apr 2025 15:57:10 +0200 Subject: [PATCH] refactor --- src/main.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index b374c4b..1d51697 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,17 +1,20 @@ use std::fmt::Display; -use std::io::Write; use std::ops::{Neg, Sub}; use std::str::FromStr; use getopts::Options; use thiserror::Error; +macro_rules! the_flag { + () => { + "F~L~Â~G{E1nb38V9a3V5e86HzlY27UFAErIP5mA34kES9fbu}" + }; +} + const T1337: Timestamp = Timestamp { hour: 13, minute: 37, }; -const TONE: Timestamp = Timestamp { hour: 1, minute: 0 }; -const TTHREE: Timestamp = Timestamp { hour: 3, minute: 0 }; const TZERO: Timestamp = Timestamp { hour: 0, minute: 0 }; fn options() -> Options { @@ -160,10 +163,7 @@ fn main() { println!("difference\t: {}", diff); if pause_time == T1337 && diff == -T1337 { - println!( - "{}", - obfstr::obfstr!("F~L~Â~G{E1nb38V9a3V5e86HzlY27UFAErIP5mA34kES9fbu}") - ) + println!("{}", obfstr::obfstr!(the_flag!())) } } @@ -176,6 +176,8 @@ fn usage(program: &str, opts: &Options) -> ! { #[cfg(test)] mod tests { use super::*; + const TONE: Timestamp = Timestamp { hour: 1, minute: 0 }; + const TTHREE: Timestamp = Timestamp { hour: 3, minute: 0 }; #[test] fn test_sanity() { assert_eq!(format!("{}", -T1337), "-13:37");