Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
raviqqe committed Dec 5, 2023
1 parent 36c1883 commit 51bbabc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion macro/src/dialect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ pub fn generate_dialect(input: DialectInput) -> Result<TokenStream, Box<dyn std:
}

// spell-checker: disable-next-line
for path in input.includes().chain([&*llvm_config("--includedir")?]) {
for path in input
.include_directories()
.chain([&*llvm_config("--includedir")?])

Check warning on line 35 in macro/src/dialect.rs

View workflow job for this annotation

GitHub Actions / spell-check

Unknown word (includedir)
{
parser = parser.add_include_path(path);
}

Expand Down
8 changes: 4 additions & 4 deletions macro/src/dialect/input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ pub struct DialectInput {
name: String,
table_gen: Option<String>,
td_file: Option<String>,
includes: Vec<String>,
include_directories: Vec<String>,
}

impl DialectInput {
Expand All @@ -24,8 +24,8 @@ impl DialectInput {
self.td_file.as_deref()
}

pub fn includes(&self) -> impl Iterator<Item = &str> {
self.includes.iter().map(Deref::deref)
pub fn include_directories(&self) -> impl Iterator<Item = &str> {
self.include_directories.iter().map(Deref::deref)
}
}

Expand All @@ -51,7 +51,7 @@ impl Parse for DialectInput {
name: name.ok_or(input.error("dialect name required"))?,
table_gen,
td_file,
includes,
include_directories: includes,
})
}
}

0 comments on commit 51bbabc

Please sign in to comment.