refactor
This commit is contained in:
parent
fcd9a961f0
commit
5292d619ee
1 changed files with 9 additions and 7 deletions
16
src/main.rs
16
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");
|
||||
|
|
Loading…
Add table
Reference in a new issue