Create advent prelude and cleanup lint by using it.
This commit is contained in:
12
2021/Cargo.lock
generated
12
2021/Cargo.lock
generated
@@ -2,10 +2,22 @@
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "advent"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"aoc-runner",
|
||||
"aoc-runner-derive",
|
||||
"pretty_assertions",
|
||||
"thiserror",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "advent2021"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"advent",
|
||||
"ansi_term",
|
||||
"anyhow",
|
||||
"aoc-runner",
|
||||
|
||||
@@ -12,3 +12,4 @@ aoc-runner = "0.3.0"
|
||||
aoc-runner-derive = "0.3.0"
|
||||
pretty_assertions = "1.0.0"
|
||||
thiserror = "1.0.30"
|
||||
advent = { path = "../" }
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
use std::{
|
||||
fmt::{Debug, Error, Formatter},
|
||||
num::ParseIntError,
|
||||
ops::{Index, IndexMut},
|
||||
str::FromStr,
|
||||
};
|
||||
|
||||
use anyhow::Result;
|
||||
use aoc_runner_derive::{aoc, aoc_generator};
|
||||
use thiserror::Error;
|
||||
use advent::prelude::*;
|
||||
use aoc_runner_derive::aoc;
|
||||
|
||||
struct Image {
|
||||
width: usize,
|
||||
@@ -182,7 +174,7 @@ fn part2(input: &str) -> Result<usize> {
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
//#[test]
|
||||
#[test]
|
||||
fn test_part1() -> Result<()> {
|
||||
let input = r#"
|
||||
6,10
|
||||
|
||||
@@ -1,15 +1,5 @@
|
||||
use std::{
|
||||
collections::{HashMap, HashSet, VecDeque},
|
||||
convert::Infallible,
|
||||
fmt::{Debug, Error, Formatter},
|
||||
num::ParseIntError,
|
||||
ops::{Index, IndexMut},
|
||||
str::FromStr,
|
||||
};
|
||||
|
||||
use anyhow::Result;
|
||||
use aoc_runner_derive::{aoc, aoc_generator};
|
||||
use thiserror::Error;
|
||||
use advent::prelude::*;
|
||||
use aoc_runner_derive::aoc;
|
||||
|
||||
struct Image {
|
||||
width: usize,
|
||||
|
||||
@@ -1,14 +1,5 @@
|
||||
use std::{
|
||||
fmt::{Debug, Error, Formatter},
|
||||
io::Read,
|
||||
num::ParseIntError,
|
||||
ops::{Index, IndexMut},
|
||||
str::FromStr,
|
||||
};
|
||||
|
||||
use anyhow::Result;
|
||||
use aoc_runner_derive::{aoc, aoc_generator};
|
||||
use thiserror::Error;
|
||||
use advent::prelude::*;
|
||||
use aoc_runner_derive::aoc;
|
||||
|
||||
fn hex(b: &u8) -> u8 {
|
||||
if *b >= b'A' {
|
||||
|
||||
@@ -3,7 +3,7 @@ pub mod day10;
|
||||
pub mod day11;
|
||||
pub mod day12;
|
||||
pub mod day13;
|
||||
pub mod day14;
|
||||
//pub mod day14;
|
||||
pub mod day15;
|
||||
pub mod day16;
|
||||
pub mod day2;
|
||||
|
||||
@@ -1,13 +1,5 @@
|
||||
use std::{
|
||||
fmt::{Debug, Error, Formatter},
|
||||
num::ParseIntError,
|
||||
ops::{Index, IndexMut},
|
||||
str::FromStr,
|
||||
};
|
||||
|
||||
use anyhow::Result;
|
||||
use advent::prelude::*;
|
||||
use aoc_runner_derive::{aoc, aoc_generator};
|
||||
use thiserror::Error;
|
||||
|
||||
#[aoc(dayX, part1)]
|
||||
fn part1(input: &str) -> Result<usize> {
|
||||
|
||||
Reference in New Issue
Block a user