Skip to content

Commit

Permalink
Fix linting (#1245)
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe authored Sep 5, 2023
1 parent a5ccf9c commit 9578280
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 19 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
[workspace]
resolver = "2"
members = [
"cmd/ein",
"lib/app",
"lib/ffi",
"lib/infra",
"lib/lang",
"lib/prelude/ffi"
"lib/prelude/ffi",
]
exclude = ["tmp"]
2 changes: 1 addition & 1 deletion cmd/ein/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "ein"
version = "0.1.0"
authors = ["Yota Toyama <[email protected]>"]
edition = "2018"
edition = "2021"

[dependencies]
app = { path = "../../lib/app" }
Expand Down
2 changes: 1 addition & 1 deletion lib/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "app"
version = "0.1.0"
authors = ["Yota Toyama <[email protected]>"]
edition = "2018"
edition = "2021"

[dependencies]
lang = { path = "../lang" }
Expand Down
11 changes: 4 additions & 7 deletions lib/app/src/common/file_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@ impl FilePath {
format!(".{extension}")
};

Self::new(
self.components().take(self.components.len() - 1).chain(
vec![regex::Regex::new(r"(\..*)?$")
Self::new(self.components().take(self.components.len() - 1).chain(
vec![regex::Regex::new(r"(\..*)?$")
.unwrap()
.replace(self.components.iter().last().unwrap(), replacement.as_str())
.deref()]
.into_iter(),
),
)
.deref()],
))
}

pub fn join(&self, file_path: &Self) -> Self {
Expand Down
2 changes: 1 addition & 1 deletion lib/ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name = "ein-ffi"
description = "FFI library for Ein programming language"
version = "0.6.0"
publish = true
edition = "2018"
edition = "2021"
license = "MIT"
authors = ["Yota Toyama <[email protected]>"]
repository = "https://github.com/ein-lang/ein"
4 changes: 2 additions & 2 deletions lib/ffi/src/arc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ impl<T> Arc<T> {

Self {
block,
phantom: PhantomData::default(),
phantom: PhantomData,
}
}
}
Expand All @@ -45,7 +45,7 @@ impl<T> Clone for Arc<T> {
fn clone(&self) -> Self {
Self {
block: self.block.clone(),
phantom: PhantomData::default(),
phantom: PhantomData,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion lib/infra/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "infra"
version = "0.1.0"
authors = ["Yota Toyama <[email protected]>"]
edition = "2018"
edition = "2021"

[dependencies]
app = { path = "../app" }
Expand Down
6 changes: 3 additions & 3 deletions lib/lang/src/compile/transform/let_error_transformer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ impl LetErrorTransformer {
let_.source_information().clone(),
);

let_.definitions().iter().rev().fold(
Ok(let_.expression().clone()),
let_.definitions().iter().rev().try_fold(
let_.expression().clone(),
|expression, variable_definition| {
let ok_type = variable_definition.type_().clone();

Expand All @@ -55,7 +55,7 @@ impl LetErrorTransformer {
variable_definition.name(),
variable_definition.body().clone(),
vec![
Alternative::new(ok_type, expression?),
Alternative::new(ok_type, expression),
Alternative::new(
error_type.clone(),
self.coerce_type(
Expand Down
2 changes: 1 addition & 1 deletion lib/lang/src/path/module_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ impl ModulePath {
.into_iter()
.chain(self.components.iter())
.map(|component| component.as_str())
.chain(vec![name].into_iter())
.chain(vec![name])
.collect::<Vec<_>>()
.join(".")
}
Expand Down
2 changes: 1 addition & 1 deletion lib/prelude/ffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
name = "prelude"
version = "0.1.0"
publish = false
edition = "2018"
edition = "2021"

[lib]
name = "prelude"
Expand Down

0 comments on commit 9578280

Please sign in to comment.