Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove ResettablePool #7688

Merged
merged 5 commits into from May 9, 2019
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.

Always

Just for now

@@ -1224,10 +1224,7 @@ mod local {
let dir = TempDir::new().unwrap();

let store = new_store(dir.path());
let hash = store
.store_bytes(EntryType::File, testdata.bytes(), false)
.wait()
.unwrap();
let hash = prime_store_with_file_bytes(&store, testdata.bytes());
assert_eq!(load_file_bytes(&store, hash), Ok(Some(testdata.bytes())));
}

@@ -1606,10 +1603,7 @@ mod local {
.store_bytes(EntryType::Directory, testdir.bytes(), false)
.wait()
.expect("Error storing");
store
.store_bytes(EntryType::File, testdata.bytes(), false)
.wait()
.expect("Error storing");
prime_store_with_file_bytes(&store, testdata.bytes());
assert_eq!(
store.entry_type(&testdata.fingerprint()),
Ok(Some(EntryType::File))
@@ -1626,10 +1620,7 @@ mod local {
.store_bytes(EntryType::Directory, testdir.bytes(), false)
.wait()
.expect("Error storing");
store
.store_bytes(EntryType::File, testdata.bytes(), false)
.wait()
.expect("Error storing");
prime_store_with_file_bytes(&store, testdata.bytes());
assert_eq!(
store.entry_type(&testdir.fingerprint()),
Ok(Some(EntryType::Directory))
@@ -1646,10 +1637,7 @@ mod local {
.store_bytes(EntryType::Directory, testdir.bytes(), false)
.wait()
.expect("Error storing");
store
.store_bytes(EntryType::File, testdata.bytes(), false)
.wait()
.expect("Error storing");
prime_store_with_file_bytes(&store, testdata.bytes());
assert_eq!(
store.entry_type(&TestDirectory::recursive().fingerprint()),
Ok(None)
@@ -1705,6 +1693,13 @@ mod local {
store.load_bytes_with(entry_type, digest, |b| b).wait()
}

fn prime_store_with_file_bytes(store: &ByteStore, bytes: Bytes) -> Digest {
store
.store_bytes(EntryType::File, bytes, false)
.wait()
.expect("Storing file bytes")

This comment has been minimized.

Copy link
@blorente

blorente May 9, 2019

Contributor

Why the change in the error string from something negative to something positive?

This comment has been minimized.

Copy link
@illicitonion

illicitonion May 9, 2019

Author Contributor

I never know which to prefer in this context. Switched back :)

}

fn get_directory_size(path: &Path) -> usize {
let mut len: usize = 0;
for entry in WalkDir::new(path) {
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.