mirror of
https://github.com/MrBeanCpp/MIT.git
synced 2026-07-02 09:16:03 +08:00
rustfmt: max-width=120
This commit is contained in:
@@ -82,11 +82,7 @@ mod test {
|
||||
util::setup_test_with_mit();
|
||||
|
||||
let index = super::Index::new();
|
||||
let mut commit = super::Commit::new(
|
||||
&index,
|
||||
vec!["123".to_string(), "456".to_string()],
|
||||
"test".to_string(),
|
||||
);
|
||||
let mut commit = super::Commit::new(&index, vec!["123".to_string(), "456".to_string()], "test".to_string());
|
||||
assert!(commit.hash.len() == 0);
|
||||
|
||||
let hash = commit.save();
|
||||
|
||||
@@ -128,8 +128,7 @@ impl Index {
|
||||
let path = Index::get_path();
|
||||
if path.exists() {
|
||||
let json = fs::read_to_string(path).expect("无法读取index");
|
||||
let relative_index: HashMap<PathBuf, FileMetaData> =
|
||||
serde_json::from_str(&json).expect("无法解析index");
|
||||
let relative_index: HashMap<PathBuf, FileMetaData> = serde_json::from_str(&json).expect("无法解析index");
|
||||
self.entries = relative_index
|
||||
.into_iter()
|
||||
.map(|(path, value)| {
|
||||
|
||||
@@ -145,9 +145,7 @@ impl Tree {
|
||||
blob_hashs.append(
|
||||
sub_blobs
|
||||
.iter()
|
||||
.map(|(path, blob_hash)| {
|
||||
(PathBuf::from(entry.name.clone()).join(path), blob_hash.clone())
|
||||
})
|
||||
.map(|(path, blob_hash)| (PathBuf::from(entry.name.clone()).join(path), blob_hash.clone()))
|
||||
.collect::<Vec<(PathBuf, Hash)>>()
|
||||
.as_mut(),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user