Skip to content

Commit

Permalink
Merge pull request #290 from korpling/feature/fix-clippy-lint
Browse files Browse the repository at this point in the history
Make sure the disk map file is emptied when writing to an existing file
  • Loading branch information
thomaskrause authored Mar 25, 2024
2 parents 9cff0fd + 7d6c3ab commit edc01f4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions core/src/util/disk_collections.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()? {
Expand Down
1 change: 1 addition & 0 deletions graphannis/src/annis/db/corpusstorage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2633,6 +2633,7 @@ fn create_lockfile_for_directory(db_dir: &Path) -> Result<File> {
.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(),
Expand Down
2 changes: 1 addition & 1 deletion graphannis/src/annis/util/quicksort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit edc01f4

Please sign in to comment.