Skip to content

Commit

Permalink
random lints
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlamonster committed Dec 8, 2023
1 parent c4a76f8 commit 9897cc9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 1 addition & 3 deletions compiler/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![allow(clippy::module_inception)]

#[cfg(feature = "debug")]
pub mod debug;
pub mod passes;
Expand All @@ -24,7 +22,7 @@ pub fn compile(program: &str, filename: &str, output: &Path) -> miette::Result<(
));

let add_source =
|error| Report::with_source_code(error, NamedSource::new(filename, program.to_string()));
|error| Report::with_source_code(error, NamedSource::new(filename, (*program).to_string()));

parse(program)
.map_err(Into::into)
Expand Down
2 changes: 2 additions & 0 deletions compiler/src/passes/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::module_inception)]

pub mod assign;
pub mod atomize;
pub mod conclude;
Expand Down
3 changes: 1 addition & 2 deletions compiler/src/utils/split_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ pub fn split_test(test: &str) -> (Vec<i64>, Vec<i64>, i64, Option<&str>) {
pub fn str_to_int(str: &str) -> i64 {
match str {
"true" => 1,
"false" => 0,
"unit" => 0,
"false" | "unit" => 0,
_ => str.parse().unwrap(),
}
}
3 changes: 2 additions & 1 deletion compiler/src/utils/union_find.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ impl<T> Default for UnionFind<T> {
}

impl<T> UnionFind<T> {
#[must_use]
pub fn new() -> Self {
Self {
parents: Vec::new(),
Expand Down Expand Up @@ -71,7 +72,7 @@ impl<T> UnionFind<T> {

// set parent of each child to root
for child_index in child_indexes {
self.parents[child_index] = child
self.parents[child_index] = child;
}

UnionIndex(parent)
Expand Down

0 comments on commit 9897cc9

Please sign in to comment.