diff --git a/core/src/util/disk_collections.rs b/core/src/util/disk_collections.rs index fb842427b..d1669e0ec 100644 --- a/core/src/util/disk_collections.rs +++ b/core/src/util/disk_collections.rs @@ -324,6 +324,7 @@ where .write(true) .read(true) .create(true) + .truncate(true) .open(location)?; let mut builder = TableBuilder::new(custom_options(self.block_cache_capacity), out_file); for entry in self.iter()? { diff --git a/graphannis/src/annis/db/corpusstorage.rs b/graphannis/src/annis/db/corpusstorage.rs index a9603f9e2..318aaed90 100644 --- a/graphannis/src/annis/db/corpusstorage.rs +++ b/graphannis/src/annis/db/corpusstorage.rs @@ -2633,6 +2633,7 @@ fn create_lockfile_for_directory(db_dir: &Path) -> Result { .read(true) .write(true) .create(true) + .truncate(true) .open(lock_file_path.as_path()) .map_err(|e| CorpusStorageError::LockCorpusDirectory { path: db_dir.to_string_lossy().to_string(), diff --git a/graphannis/src/annis/util/quicksort.rs b/graphannis/src/annis/util/quicksort.rs index b346f9bb4..eb54a736e 100644 --- a/graphannis/src/annis/util/quicksort.rs +++ b/graphannis/src/annis/util/quicksort.rs @@ -119,7 +119,7 @@ where let v2 = (i2, items.try_get(i2)?.into_owned()); let v3 = (i3, items.try_get(i3)?.into_owned()); - let mut v = vec![v1, v2, v3]; + let mut v = [v1, v2, v3]; // Adapted median creation using swaps from // https://en.wikipedia.org/wiki/Quicksort#Choice_of_pivot let low = 0;