comparison rust/hg-core/src/revlog/filelog.rs @ 52291:f90796d33aa0

rust: fix clippy lints These were highlighted by the latest version of clippy (1.82.0).
author Rapha?l Gom?s <rgomes@octobus.net>
date Tue, 29 Oct 2024 11:35:01 +0100
parents a3fa37bdb7ec
children b0b6c28b340b
comparison
equal deleted inserted replaced
52290:a3fa37bdb7ec 52291:f90796d33aa0
215 pub struct FilelogRevisionData(Vec<u8>); 215 pub struct FilelogRevisionData(Vec<u8>);
216 216
217 impl FilelogRevisionData { 217 impl FilelogRevisionData {
218 /// Split into metadata and data 218 /// Split into metadata and data
219 pub fn split(&self) -> Result<(Option<&[u8]>, &[u8]), HgError> { 219 pub fn split(&self) -> Result<(Option<&[u8]>, &[u8]), HgError> {
220 const DELIMITER: &[u8; 2] = &[b'\x01', b'\n']; 220 const DELIMITER: &[u8; 2] = b"\x01\n";
221 221
222 if let Some(rest) = self.0.drop_prefix(DELIMITER) { 222 if let Some(rest) = self.0.drop_prefix(DELIMITER) {
223 if let Some((metadata, data)) = rest.split_2_by_slice(DELIMITER) { 223 if let Some((metadata, data)) = rest.split_2_by_slice(DELIMITER) {
224 Ok((Some(metadata), data)) 224 Ok((Some(metadata), data))
225 } else { 225 } else {