Skip to content

Commit ec40e09

Browse files
committed
Fix clippy
1 parent 313064f commit ec40e09

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

Diff for: git-odb/src/pack/data/decoded.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,11 @@ fn leb64decode(d: &[u8]) -> (u64, usize) {
7676
fn streaming_leb64decode(mut r: impl io::Read) -> Result<(u64, usize), io::Error> {
7777
let mut b = [0u8; 1];
7878
let mut i = 0;
79-
r.read(&mut b)?;
79+
r.read_exact(&mut b)?;
8080
i += 1;
8181
let mut value = b[0] as u64 & 0x7f;
8282
while b[0] & 0x80 != 0 {
83-
r.read(&mut b)?;
83+
r.read_exact(&mut b)?;
8484
i += 1;
8585
value += 1;
8686
value = (value << 7) + (b[0] as u64 & 0x7f)

Diff for: git-odb/src/pack/index/verify/indexed.rs

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ impl index::File {
2121
let r =
2222
io::BufReader::new(fs::File::open(pack.path()).map_err(|err| Error::Io(err, pack.path().into(), "open"))?);
2323
pack::graph::DeltaTree::from_sorted_offsets(self.sorted_offsets().into_iter(), r, indexing_progress)?;
24+
2425
unimplemented!()
2526
}
2627
}

Diff for: gitoxide-core/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,15 +163,15 @@ where
163163
let idx = git_odb::pack::index::File::at(path).with_context(|| "Could not open pack index file")?;
164164
let packfile_path = path.with_extension("pack");
165165
let pack = git_odb::pack::data::File::at(&packfile_path)
166-
.or_else(|e| {
166+
.map_err(|e| {
167167
writeln!(
168168
err,
169169
"Could not find matching pack file at '{}' - only index file will be verified, error was: {}",
170170
packfile_path.display(),
171171
e
172172
)
173173
.ok();
174-
Err(e)
174+
e
175175
})
176176
.ok();
177177
let cache = || -> EitherCache {

Diff for: src/plumbing/lean.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ pub fn main() -> Result<()> {
118118
} else {
119119
None
120120
},
121-
algorithm: algorithm.unwrap_or(core::VerifyAlgorithm::Lookup).into(),
121+
algorithm: algorithm.unwrap_or(core::VerifyAlgorithm::Lookup),
122122
thread_limit,
123123
mode: match (decode, re_encode) {
124124
(true, false) => core::VerifyMode::Sha1CRC32Decode,

Diff for: src/plumbing/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,7 @@ pub fn main() -> Result<()> {
208208
core::Context {
209209
output_statistics,
210210
thread_limit,
211-
algorithm: algorithm.into(),
211+
algorithm,
212212
mode,
213213
out,
214214
err,

0 commit comments

Comments
 (0)