chore: run cargo fmt
This commit is contained in:
parent
00000290a2
commit
00000300d5
|
@ -1,4 +1,4 @@
|
||||||
use serde_json::{Value, Value::*, from_str};
|
use serde_json::{from_str, Value, Value::*};
|
||||||
|
|
||||||
fn parse_add(json_object: &Value, skip_red: bool) -> i32 {
|
fn parse_add(json_object: &Value, skip_red: bool) -> i32 {
|
||||||
match json_object {
|
match json_object {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
use std::{ops::Add, iter::once};
|
use std::{iter::once, ops::Add};
|
||||||
|
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
static ref RE: Regex = Regex::new(r#"-?\d+"#).unwrap();
|
static ref RE: Regex = Regex::new(r#"-?\d+"#).unwrap();
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
use dotenv::dotenv;
|
use dotenv::dotenv;
|
||||||
use reqwest::blocking::Client;
|
use reqwest::{blocking::Client, header};
|
||||||
use reqwest::header;
|
|
||||||
use std::{env, fs::OpenOptions, io::Write, process};
|
use std::{env, fs::OpenOptions, io::Write, process};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
|
@ -28,9 +27,7 @@ fn main() {
|
||||||
|
|
||||||
let client = Client::builder().default_headers(headers).build().unwrap();
|
let client = Client::builder().default_headers(headers).build().unwrap();
|
||||||
let res = client
|
let res = client
|
||||||
.get(format!(
|
.get(format!("https://adventofcode.com/{year}/day/{day}/input"))
|
||||||
"https://adventofcode.com/{year}/day/{day}/input"
|
|
||||||
))
|
|
||||||
.send()
|
.send()
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.text()
|
.text()
|
||||||
|
|
|
@ -39,7 +39,5 @@ fn main() {
|
||||||
})
|
})
|
||||||
.sum();
|
.sum();
|
||||||
|
|
||||||
println!(
|
println!("{ANSI_BOLD}Total:{ANSI_RESET} {ANSI_ITALIC}{total:.2}ms{ANSI_RESET}");
|
||||||
"{ANSI_BOLD}Total:{ANSI_RESET} {ANSI_ITALIC}{total:.2}ms{ANSI_RESET}"
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue