Skip to content

Commit

Permalink
Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Jul 20, 2020
1 parent 313064f commit ec40e09
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions git-odb/src/pack/data/decoded.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ fn leb64decode(d: &[u8]) -> (u64, usize) {
fn streaming_leb64decode(mut r: impl io::Read) -> Result<(u64, usize), io::Error> {
let mut b = [0u8; 1];
let mut i = 0;
r.read(&mut b)?;
r.read_exact(&mut b)?;
i += 1;
let mut value = b[0] as u64 & 0x7f;
while b[0] & 0x80 != 0 {
r.read(&mut b)?;
r.read_exact(&mut b)?;
i += 1;
value += 1;
value = (value << 7) + (b[0] as u64 & 0x7f)
Expand Down
1 change: 1 addition & 0 deletions git-odb/src/pack/index/verify/indexed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ impl index::File {
let r =
io::BufReader::new(fs::File::open(pack.path()).map_err(|err| Error::Io(err, pack.path().into(), "open"))?);
pack::graph::DeltaTree::from_sorted_offsets(self.sorted_offsets().into_iter(), r, indexing_progress)?;

unimplemented!()
}
}
4 changes: 2 additions & 2 deletions gitoxide-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,15 @@ where
let idx = git_odb::pack::index::File::at(path).with_context(|| "Could not open pack index file")?;
let packfile_path = path.with_extension("pack");
let pack = git_odb::pack::data::File::at(&packfile_path)
.or_else(|e| {
.map_err(|e| {
writeln!(
err,
"Could not find matching pack file at '{}' - only index file will be verified, error was: {}",
packfile_path.display(),
e
)
.ok();
Err(e)
e
})
.ok();
let cache = || -> EitherCache {
Expand Down
2 changes: 1 addition & 1 deletion src/plumbing/lean.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ pub fn main() -> Result<()> {
} else {
None
},
algorithm: algorithm.unwrap_or(core::VerifyAlgorithm::Lookup).into(),
algorithm: algorithm.unwrap_or(core::VerifyAlgorithm::Lookup),
thread_limit,
mode: match (decode, re_encode) {
(true, false) => core::VerifyMode::Sha1CRC32Decode,
Expand Down
2 changes: 1 addition & 1 deletion src/plumbing/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ pub fn main() -> Result<()> {
core::Context {
output_statistics,
thread_limit,
algorithm: algorithm.into(),
algorithm,
mode,
out,
err,
Expand Down

0 comments on commit ec40e09

Please sign in to comment.