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::fmt::Display;
|
||||||
use std::io::Write;
|
|
||||||
use std::ops::{Neg, Sub};
|
use std::ops::{Neg, Sub};
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
use getopts::Options;
|
use getopts::Options;
|
||||||
use thiserror::Error;
|
use thiserror::Error;
|
||||||
|
|
||||||
|
macro_rules! the_flag {
|
||||||
|
() => {
|
||||||
|
"F~L~Â~G{E1nb38V9a3V5e86HzlY27UFAErIP5mA34kES9fbu}"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
const T1337: Timestamp = Timestamp {
|
const T1337: Timestamp = Timestamp {
|
||||||
hour: 13,
|
hour: 13,
|
||||||
minute: 37,
|
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 };
|
const TZERO: Timestamp = Timestamp { hour: 0, minute: 0 };
|
||||||
|
|
||||||
fn options() -> Options {
|
fn options() -> Options {
|
||||||
|
@ -160,10 +163,7 @@ fn main() {
|
||||||
println!("difference\t: {}", diff);
|
println!("difference\t: {}", diff);
|
||||||
|
|
||||||
if pause_time == T1337 && diff == -T1337 {
|
if pause_time == T1337 && diff == -T1337 {
|
||||||
println!(
|
println!("{}", obfstr::obfstr!(the_flag!()))
|
||||||
"{}",
|
|
||||||
obfstr::obfstr!("F~L~Â~G{E1nb38V9a3V5e86HzlY27UFAErIP5mA34kES9fbu}")
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -176,6 +176,8 @@ fn usage(program: &str, opts: &Options) -> ! {
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
const TONE: Timestamp = Timestamp { hour: 1, minute: 0 };
|
||||||
|
const TTHREE: Timestamp = Timestamp { hour: 3, minute: 0 };
|
||||||
#[test]
|
#[test]
|
||||||
fn test_sanity() {
|
fn test_sanity() {
|
||||||
assert_eq!(format!("{}", -T1337), "-13:37");
|
assert_eq!(format!("{}", -T1337), "-13:37");
|
||||||
|
|
Loading…
Add table
Reference in a new issue