MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / newline_normalized

Function newline_normalized

atomic-repository/src/repository/equivalence.rs:735–748  ·  view source on GitHub ↗
(bytes: &[u8])

Source from the content-addressed store, hash-verified

733}
734
735fn newline_normalized(bytes: &[u8]) -> Vec<u8> {
736 let mut normalized = Vec::with_capacity(bytes.len());
737 let mut index = 0;
738 while index < bytes.len() {
739 if bytes[index..].starts_with(b"\r\n") {
740 normalized.push(b'\n');
741 index += 2;
742 } else {
743 normalized.push(bytes[index]);
744 index += 1;
745 }
746 }
747 normalized
748}
749
750fn format_bytes(bytes: &[u8]) -> String {
751 const HEX: &[u8; 16] = b"0123456789abcdef";

Callers 1

compare_worktree_intoFunction · 0.85

Calls 2

lenMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected