chore: fix clippy
This commit is contained in:
parent
95d37159fc
commit
bfc0e7f7b7
@ -1,4 +1,6 @@
|
||||
#[derive(thiserror::Error, Debug)]
|
||||
use thiserror::Error;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
pub enum RuntimeError {
|
||||
#[error("Invalid character found")]
|
||||
UnexpectedChar,
|
||||
|
@ -61,7 +61,7 @@ fn main() -> Result<(), Error> {
|
||||
Err(e) => eprintln!("Failed to initialize repository: {}", e),
|
||||
},
|
||||
Command::CatFile { hash } => match read_object(&path, &hash) {
|
||||
Ok(mut obj) => println!("{}", obj.to_string()?),
|
||||
Ok(mut obj) => println!("{}", obj.string()?),
|
||||
Err(e) => eprintln!("Failed to read object: {}", e),
|
||||
},
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ pub fn read_object(path: &Path, object: &str) -> Result<Object<impl BufRead>> {
|
||||
}
|
||||
|
||||
impl<R: BufRead> Object<R> {
|
||||
pub fn to_string(&mut self) -> Result<String> {
|
||||
pub fn string(&mut self) -> Result<String> {
|
||||
let mut buf: Vec<u8> = Vec::new();
|
||||
let mut buf_hash: [u8; 20] = [0; 20];
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user