From d2ac69816567f092fe0d4661723bc43778cb481b Mon Sep 17 00:00:00 2001 From: DanConwayDev Date: Mon, 1 Dec 2025 14:31:32 +0000 Subject: fix cargo clippy and fmt warnings --- src/git/protocol.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/git/protocol.rs') diff --git a/src/git/protocol.rs b/src/git/protocol.rs index 93177de..8592c27 100644 --- a/src/git/protocol.rs +++ b/src/git/protocol.rs @@ -55,11 +55,11 @@ impl PktLine { return Err(ProtocolError::InsufficientData); } - let len_str = std::str::from_utf8(&input[0..4]) - .map_err(|_| ProtocolError::InvalidLength)?; - - let len = u16::from_str_radix(len_str, 16) - .map_err(|_| ProtocolError::InvalidLength)? as usize; + let len_str = + std::str::from_utf8(&input[0..4]).map_err(|_| ProtocolError::InvalidLength)?; + + let len = + u16::from_str_radix(len_str, 16).map_err(|_| ProtocolError::InvalidLength)? as usize; if len == 0 { // Flush packet @@ -81,19 +81,19 @@ impl PktLine { /// Parse all pkt-lines from bytes pub fn parse_all(mut input: &[u8]) -> Result, ProtocolError> { let mut packets = Vec::new(); - + while !input.is_empty() { let (packet, remaining) = Self::parse(input)?; let is_flush = matches!(packet, PktLine::Flush); packets.push(packet); input = remaining; - + // Stop at flush packet if is_flush { break; } } - + Ok(packets) } } @@ -259,4 +259,4 @@ mod tests { "application/x-git-upload-pack-result" ); } -} \ No newline at end of file +} -- cgit v1.2.3