diff rust/hg-core/src/revlog/filelog.rs @ 49930:e98fd81bb151

rust-clippy: fix most warnings in `hg-core` All of these are simple changes that for the most part are clear improvements and the rest are at most equivalent. The remaining warnings have to be fixed either with a bigger refactor like for the nested "revlog" module, or in the dependency `bytes-cast`, which we own. This will be done sometime in the future.
author Rapha?l Gom?s <rgomes@octobus.net>
date Mon, 09 Jan 2023 19:18:43 +0100
parents 52464a20add0
children 750409505286
line wrap: on
line diff
--- a/rust/hg-core/src/revlog/filelog.rs	Mon Jan 09 19:14:14 2023 +0100
+++ b/rust/hg-core/src/revlog/filelog.rs	Mon Jan 09 19:18:43 2023 +0100
@@ -49,7 +49,7 @@
         file_rev: Revision,
     ) -> Result<FilelogRevisionData, RevlogError> {
         let data: Vec<u8> = self.revlog.get_rev_data(file_rev)?.into_owned();
-        Ok(FilelogRevisionData(data.into()))
+        Ok(FilelogRevisionData(data))
     }
 
     /// The given node ID is that of the file as found in a filelog, not of a
@@ -161,7 +161,7 @@
         // this `FilelogEntry` does not have such metadata:
         let file_data_len = uncompressed_len;
 
-        return file_data_len != other_len;
+        file_data_len != other_len
     }
 
     pub fn data(&self) -> Result<FilelogRevisionData, HgError> {