Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
jw3 committed Nov 12, 2024
1 parent 45fd5b6 commit 18690d4
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 13 deletions.
6 changes: 1 addition & 5 deletions crates/rules/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,7 @@ impl From<Vec<(Origin, Entry)>> for DB {
impl DB {
/// Construct DB using the provided RuleDefs and associated sources
pub(crate) fn from_sources(defs: Vec<(Origin, Entry)>) -> Self {
let model: BTreeMap<usize, DbEntry> = defs
.into_iter()
.enumerate()
.map(|(i, (source, d))| (i, (source, d)))
.collect();
let model: BTreeMap<usize, DbEntry> = defs.into_iter().enumerate().collect();

let rules: BTreeMap<usize, RuleEntry> = model
.iter()
Expand Down
2 changes: 1 addition & 1 deletion crates/rules/src/load.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ fn rules_file(path: PathBuf) -> Result<Vec<RuleSource>, io::Error> {
let reader = File::open(&path).map(BufReader::new)?;
let lines = reader
.lines()
.flatten()
.map_while(Result::ok)
.map(|s| (path.clone(), s))
.collect();
Ok(lines)
Expand Down
4 changes: 0 additions & 4 deletions crates/rules/src/parser/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,12 @@ impl<I: PartialEq> PartialEq for Trace<I> {
}
}

///
impl<I> Position for Trace<I> {
fn position(&self) -> usize {
self.position
}
}

///
impl<I: Offset> Offset for Trace<I> {
fn offset(&self, second: &Self) -> usize {
self.current.offset(&second.current)
Expand Down
6 changes: 3 additions & 3 deletions crates/rules/src/read.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ enum Line {
enum LineError<I> {
CannotParseSet(I, String),
CannotParse(I, String),
Nom(I, ErrorKind),
Nom(I, ()),
}

impl<I> ParseError<I> for LineError<I> {
fn from_error_kind(input: I, kind: ErrorKind) -> Self {
LineError::Nom(input, kind)
fn from_error_kind(input: I, _kind: ErrorKind) -> Self {
LineError::Nom(input, ())
}

fn append(_: I, _: ErrorKind, other: Self) -> Self {
Expand Down

0 comments on commit 18690d4

Please sign in to comment.