refactor: formatting
parent
c0a705bb33
commit
d23d02413e
|
@ -970,6 +970,7 @@ impl ResponseError for ExternalFetchError {
|
|||
}
|
||||
|
||||
const MAX_EXTERNAL_SIZE: usize = 128_000_000;
|
||||
|
||||
#[tracing::instrument(skip(url), fields(url = % url))]
|
||||
fn fetch_external(url: Url) -> Result<(bytes::Bytes, Option<String>), ExternalFetchError> {
|
||||
debug!("Fetching...");
|
||||
|
|
|
@ -323,7 +323,7 @@ impl FsStore {
|
|||
} else {
|
||||
trace!("Re-added: {:?}", path);
|
||||
Ok(UpdatePathOutcome::Added(path.clone()))
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -941,7 +941,18 @@ mod test {
|
|||
.filter(|upo| matches!(upo, UpdatePathOutcome::Removed(_)))
|
||||
.count()
|
||||
);
|
||||
assert!(store.retrieve_all_files().unwrap().iter().filter(|f| f.path == "hello-world.txt").all(|f| !f.valid));
|
||||
assert!(store
|
||||
.retrieve_all_files()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.filter(|f| f.path == "hello-world.txt")
|
||||
.all(|f| !f.valid));
|
||||
assert!(store
|
||||
.retrieve_all_files()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.filter(|f| f.path == "hello-world.txt")
|
||||
.all(|f| !f.valid));
|
||||
|
||||
// Re-add the file
|
||||
let file_path = temp_dir_path.join("hello-world.txt");
|
||||
|
@ -982,7 +993,18 @@ mod test {
|
|||
.filter(|upo| matches!(upo, UpdatePathOutcome::Added(_)))
|
||||
.count()
|
||||
);
|
||||
assert!(store.retrieve_all_files().unwrap().iter().filter(|f| f.path == "hello-world.txt").all(|f| f.valid));
|
||||
assert!(store
|
||||
.retrieve_all_files()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.filter(|f| f.path == "hello-world.txt")
|
||||
.all(|f| f.valid));
|
||||
assert!(store
|
||||
.retrieve_all_files()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.filter(|f| f.path == "hello-world.txt")
|
||||
.all(|f| f.valid));
|
||||
}
|
||||
|
||||
/// Prepare a temporary filesystem structure for testing
|
||||
|
|
Loading…
Reference in New Issue