fix cargo warnings.
This commit is contained in:
parent
4c11c4df3e
commit
44c6da936e
|
@ -14,10 +14,6 @@ impl Range {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn calc_size(&self) -> u16 {
|
|
||||||
self.start.abs_diff(self.end)
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn any_overlap(&self, other: &Self) -> bool {
|
pub fn any_overlap(&self, other: &Self) -> bool {
|
||||||
self.start <= other.end && self.end >= other.start
|
self.start <= other.end && self.end >= other.start
|
||||||
}
|
}
|
||||||
|
@ -31,14 +27,6 @@ impl Range {
|
||||||
pub fn complete_overlap(&self, other: &Self) -> bool {
|
pub fn complete_overlap(&self, other: &Self) -> bool {
|
||||||
self.calc_overlap(other) == *self || self.calc_overlap(other) == *other
|
self.calc_overlap(other) == *self || self.calc_overlap(other) == *other
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn start(&self) -> u16 {
|
|
||||||
self.start
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn end(&self) -> u16 {
|
|
||||||
self.end
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static PARSE_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"^(\d+)-(\d+),(\d+)-(\d+)").unwrap());
|
static PARSE_REGEX: Lazy<Regex> = Lazy::new(|| Regex::new(r"^(\d+)-(\d+),(\d+)-(\d+)").unwrap());
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![allow(unused)]
|
||||||
use std::{rc::{Weak, Rc}, cell::RefCell};
|
use std::{rc::{Weak, Rc}, cell::RefCell};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
|
@ -1,4 +1,5 @@
|
||||||
use crate::fileTree::*;
|
#![allow(unused)]
|
||||||
|
use crate::file_tree::*;
|
||||||
use once_cell::sync::Lazy;
|
use once_cell::sync::Lazy;
|
||||||
use regex::Regex;
|
use regex::Regex;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use crate::fileTree::*;
|
#![allow(unused)]
|
||||||
|
use crate::file_tree::*;
|
||||||
use crate::parser::*;
|
use crate::parser::*;
|
||||||
|
|
||||||
pub fn part1() -> usize {
|
pub fn part1() -> usize {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
use crate::fileTree::*;
|
#![allow(unused)]
|
||||||
|
use crate::file_tree::*;
|
||||||
use crate::parser::*;
|
use crate::parser::*;
|
||||||
|
|
||||||
pub fn part2() -> usize {
|
pub fn part2() -> usize {
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
|
#![allow(unused)]
|
||||||
mod part1;
|
mod part1;
|
||||||
mod part2;
|
mod part2;
|
||||||
mod parser;
|
mod parser;
|
||||||
mod fileTree;
|
mod file_tree;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _input = include_str!("./input.txt");
|
let input = include_str!("./input.txt");
|
||||||
let _structured_input = parser::parse(_input);
|
let structured_input = parser::parse(input);
|
||||||
|
|
||||||
println!("Part One");
|
println!("Part One");
|
||||||
println!("Result: {}", part1::part1());
|
println!("Result: {}", part1::part1());
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![allow(unused)]
|
||||||
use crate::utilities::*;
|
use crate::utilities::*;
|
||||||
|
|
||||||
pub fn part1() -> usize {
|
pub fn part1() -> usize {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![allow(unused)]
|
||||||
use crate::utilities::*;
|
use crate::utilities::*;
|
||||||
|
|
||||||
pub fn part2() -> usize {
|
pub fn part2() -> usize {
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
|
#![allow(unused)]
|
||||||
mod part1;
|
mod part1;
|
||||||
mod part2;
|
mod part2;
|
||||||
mod utilities;
|
mod utilities;
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let _input = include_str!("./input.txt");
|
let input = include_str!("./input.txt");
|
||||||
let _structured_input = utilities::parse(_input);
|
let structured_input = utilities::parse(input);
|
||||||
|
|
||||||
println!("Part One");
|
println!("Part One");
|
||||||
println!("Result: {}", part1::part1());
|
println!("Result: {}", part1::part1());
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
#![allow(unused)]
|
||||||
pub fn parse(input: &str) -> usize {
|
pub fn parse(input: &str) -> usize {
|
||||||
unimplemented!()
|
unimplemented!()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue