Skip to content

Commit

Permalink
thanks clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed May 13, 2021
1 parent 513e7ad commit 334e129
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions git-packetline/src/read/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ pub struct StreamingPeekReader<T> {
stopped_at: Option<PacketLine<'static>>,
}

type ExhaustiveOutcome<'a> = (
bool, // is_done
Option<PacketLine<'static>>, // stopped_at
Option<io::Result<Result<PacketLine<'a>, decode::Error>>>, // actual method result
);

impl<T> StreamingPeekReader<T>
where
T: io::Read,
Expand Down Expand Up @@ -91,17 +97,15 @@ where
}
}

/// This function is needed to help the borrow checker allow us to return references all the time
/// It contains a bunch of logic shared between peek and read_line invocations.
fn read_line_inner_exhaustive<'a>(
reader: &mut T,
buf: &'a mut Vec<u8>,
delimiters: &[PacketLine<'static>],
fail_on_err_lines: bool,
buf_resize: bool,
) -> (
bool,
Option<PacketLine<'static>>,
Option<io::Result<Result<PacketLine<'a>, decode::Error>>>,
) {
) -> ExhaustiveOutcome<'a> {
(
false,
None,
Expand Down

0 comments on commit 334e129

Please sign in to comment.