mirror of
https://github.com/bertptrs/adventofcode.git
synced 2025-12-26 05:10:32 +01:00
Clean up day 13 a little.
This commit is contained in:
@@ -53,7 +53,7 @@ impl<'a, I: FromStr> LineParser<'a, I> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, I: FromStr> Iterator for LineParser<'a, I> {
|
||||
impl<I: FromStr> Iterator for LineParser<'_, I> {
|
||||
type Item = I;
|
||||
|
||||
fn next(&mut self) -> Option<Self::Item> {
|
||||
@@ -61,6 +61,15 @@ impl<'a, I: FromStr> Iterator for LineParser<'a, I> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<'a, I: FromStr> From<LineIter<'a>> for LineParser<'a, I> {
|
||||
fn from(iter: LineIter<'a>) -> Self {
|
||||
Self {
|
||||
iter,
|
||||
_data: PhantomData,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Return two arguments in their natural PartialOrd order
|
||||
pub fn ordered<O: PartialOrd>(a: O, b: O) -> (O, O) {
|
||||
if a < b {
|
||||
|
||||
Reference in New Issue
Block a user