Fix indentation and formatting
This commit is contained in:
parent
6d73024183
commit
85ae7c1f60
7 changed files with 27 additions and 43 deletions
|
@ -133,8 +133,7 @@ async fn main() {
|
|||
.get_matches();
|
||||
|
||||
let address = matches.value_of("address").unwrap_or("0.0.0.0");
|
||||
let port = std::env::var("PORT")
|
||||
.unwrap_or_else(|_| matches.value_of("port").unwrap_or("8080").to_string());
|
||||
let port = std::env::var("PORT").unwrap_or_else(|_| matches.value_of("port").unwrap_or("8080").to_string());
|
||||
let hsts = matches.value_of("hsts");
|
||||
|
||||
let listener = [address, ":", &port].concat();
|
||||
|
|
25
src/utils.rs
25
src/utils.rs
|
@ -634,25 +634,10 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn format_num_works() {
|
||||
assert_eq!(
|
||||
format_num(567),
|
||||
("567".to_string(), "567".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
format_num(1234),
|
||||
("1.2k".to_string(), "1234".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
format_num(1999),
|
||||
("2.0k".to_string(), "1999".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
format_num(1001),
|
||||
("1.0k".to_string(), "1001".to_string())
|
||||
);
|
||||
assert_eq!(
|
||||
format_num(1_999_999),
|
||||
("2.0m".to_string(), "1999999".to_string())
|
||||
);
|
||||
assert_eq!(format_num(567), ("567".to_string(), "567".to_string()));
|
||||
assert_eq!(format_num(1234), ("1.2k".to_string(), "1234".to_string()));
|
||||
assert_eq!(format_num(1999), ("2.0k".to_string(), "1999".to_string()));
|
||||
assert_eq!(format_num(1001), ("1.0k".to_string(), "1001".to_string()));
|
||||
assert_eq!(format_num(1_999_999), ("2.0m".to_string(), "1999999".to_string()));
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue