Avoid clone() call

This commit is contained in:
Laurentiu Nicola
2017-05-13 16:11:07 +03:00
parent 695c8828b8
commit ee0873dd07

View File

@@ -71,8 +71,7 @@ impl Drop for FileProtection {
/// Saves the file containing the list of existing files
/// that were created by tantivy.
fn save_managed_paths(directory: &mut Directory, wlock: &RwLockWriteGuard<MetaInformation>) -> io::Result<()> {
let managed_paths = wlock.managed_paths.clone();
let mut w = serde_json::to_vec(&managed_paths)?;
let mut w = serde_json::to_vec(&wlock.managed_paths)?;
write!(&mut w, "\n")?;
directory.atomic_write(&MANAGED_FILEPATH, &w[..])?;
Ok(())