Skip to content

Commit

Permalink
Merge branch 'main' into fix_fr_loading
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross35 authored Jun 12, 2024
2 parents ab2ba45 + 2deff3a commit 93b2da4
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/validation-rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@beta
with:
components: clippy
- uses: Swatinem/rust-cache@v2
Expand Down
1 change: 1 addition & 0 deletions zspell-cli/src/download.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ fn open_new_file(path: &Path, overwrite: bool) -> anyhow::Result<File> {
.write(true)
.read(true)
.create(true)
.truncate(true)
.open(path)
.context(format!("unable to open '{fname}' in '{dir}'"))
} else {
Expand Down
1 change: 1 addition & 0 deletions zspell/benches/datastructure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
//! might use in our spellchecker

#![allow(clippy::disallowed_types)]
#![allow(clippy::incompatible_msrv)]

use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet};
use std::fs::File;
Expand Down
2 changes: 2 additions & 0 deletions zspell/benches/dict_integration.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::incompatible_msrv)]

use std::fs;
use std::hint::black_box;

Expand Down
2 changes: 2 additions & 0 deletions zspell/benches/slice_contains.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Benchmark the difference between contains & `binary_search`es, intended

#![allow(clippy::incompatible_msrv)]

use std::hint::black_box;

use criterion::{criterion_group, criterion_main, Criterion};
Expand Down
1 change: 1 addition & 0 deletions zspell/benches/small_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
//! situ (should only affect compile times)

#![allow(clippy::disallowed_types)]
#![allow(clippy::incompatible_msrv)]

use std::collections::{BTreeMap, HashMap};
use std::hint::black_box;
Expand Down
2 changes: 2 additions & 0 deletions zspell/benches/word_splitter.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::incompatible_msrv)]

use std::hint::black_box;

use criterion::{criterion_group, criterion_main, Criterion};
Expand Down
1 change: 1 addition & 0 deletions zspell/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ fn emit_autocfg() {

// check if we have `Box<[T]>: From<&[T: Clone]>` loosened from `T: Copy` (1.71)
ac.emit_expression_cfg(PROBE_BOX, "box_from_slice_has_clone_bound");
println!("cargo:rustc-check-cfg=cfg(box_from_slice_has_clone_bound)");
}
2 changes: 1 addition & 1 deletion zspell/src/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ impl Dictionary {
let mut nosuggest = false;

for flag in flags {
if self.affix_flags.get(flag).is_none() {
if !self.affix_flags.contains_key(flag) {
// FIXME: we get stuck on compound rules
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion zspell/src/dict/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ pub enum Source {
/// The full rule that created this
rule: Arc<AfxRule>,
/// Index of the relevant pattern within the rule. This could potentially be a reference
/// but that might require a RefCell, and I don't want to risk reference
/// but that might require a `RefCell`, and I don't want to risk reference
pat_idx: usize,
},
/// This meta came from a .dic file, only contains morphinfo
Expand Down
4 changes: 3 additions & 1 deletion zspell/src/dict/rule.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ impl AfxRule {
ret.patterns.push(AfxRulePattern {
affix: rule.affix.as_str().into(),
condition: rule.condition.clone(),
strip: rule.strip.as_ref().map(Arc::clone),
// FIXME: `rule.strip.as_ref().map(Arc::clone)` is more accurate, but flagged by
// clippy
strip: rule.strip.clone(),
morph_info,
});
}
Expand Down
2 changes: 2 additions & 0 deletions zspell/test-util/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
//! Utilities intended to help with test collection

#![forbid(unsafe_code)]
#![allow(clippy::assigning_clones)]

use std::collections::BTreeMap;
use std::fmt::Write;
Expand Down

0 comments on commit 93b2da4

Please sign in to comment.