@@ -18,7 +18,7 @@ pub fn parse(input: &str) -> Vec<&str> {
1818}
1919
2020pub fn part1 ( input : & [ & str ] ) -> u64 {
21- fn helper ( bytes : & mut Bytes ) -> u64 {
21+ fn helper ( bytes : & mut Bytes < ' _ > ) -> u64 {
2222 let mut total = value ( bytes, helper) ;
2323
2424 while let Some ( operation) = next ( bytes) {
@@ -37,7 +37,7 @@ pub fn part1(input: &[&str]) -> u64 {
3737}
3838
3939pub fn part2 ( input : & [ & str ] ) -> u64 {
40- fn helper ( bytes : & mut Bytes ) -> u64 {
40+ fn helper ( bytes : & mut Bytes < ' _ > ) -> u64 {
4141 let mut total = value ( bytes, helper) ;
4242
4343 while let Some ( operation) = next ( bytes) {
@@ -60,7 +60,7 @@ pub fn part2(input: &[&str]) -> u64 {
6060/// Convenience wrapper around [`Bytes`] iterator. Encountering a `)` is also considered end of
6161/// sequence. The expressions are consistently formatted so encountering a space just means
6262/// skip and return the next character that will always be present.
63- fn next ( bytes : & mut Bytes ) -> Option < u8 > {
63+ fn next ( bytes : & mut Bytes < ' _ > ) -> Option < u8 > {
6464 match bytes. next ( ) {
6565 None | Some ( b')' ) => None ,
6666 Some ( b' ' ) => bytes. next ( ) ,
@@ -70,7 +70,7 @@ fn next(bytes: &mut Bytes) -> Option<u8> {
7070
7171/// Convenience wrapper to return the value of either the next raw digit literal or a
7272/// sub-expression nested in parentheses.
73- fn value ( bytes : & mut Bytes , helper : impl Fn ( & mut Bytes ) -> u64 ) -> u64 {
73+ fn value ( bytes : & mut Bytes < ' _ > , helper : impl Fn ( & mut Bytes < ' _ > ) -> u64 ) -> u64 {
7474 match next ( bytes) . unwrap ( ) {
7575 b'(' => helper ( bytes) ,
7676 b => b. to_decimal ( ) as u64 ,
0 commit comments