MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / main

Function main

17_regex/rust/io_regex/src/main.rs:14–35  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12}
13
14fn main() {
15 println!("Type 'quit' to exit.");
16 let mut input = String::new();
17 loop {
18 io::stdin().read_line(&mut input).unwrap();
19 input.truncate(input.len() - 1); // remove trailing newline
20
21 if input == "quit" {
22 println!("Good bye");
23 break;
24 }
25
26 let is_date = is_proper_date(&input);
27 //let is_date = iso_8601::is_8601_date(&input);
28 println!(
29 "{0} is{1}a date",
30 input,
31 if is_date { " " } else { " not " }
32 );
33 input.clear();
34 }
35}

Callers

nothing calls this directly

Calls 2

read_lineMethod · 0.80
is_proper_dateFunction · 0.70

Tested by

no test coverage detected