diff --git a/crates/codegen/parser/generator/src/code_generator.rs b/crates/codegen/parser/generator/src/code_generator.rs index 2ab13c88d6..63fb5c578b 100644 --- a/crates/codegen/parser/generator/src/code_generator.rs +++ b/crates/codegen/parser/generator/src/code_generator.rs @@ -2,7 +2,6 @@ use std::{ collections::{BTreeMap, BTreeSet}, mem, path::PathBuf, - rc::Rc, }; use anyhow::Result; @@ -58,7 +57,7 @@ struct ScannerContext { } impl CodeGenerator { - pub fn write_source(output_dir: &PathBuf, grammar: Rc) -> Result<()> { + pub fn write_source(output_dir: &PathBuf, grammar: &Grammar) -> Result<()> { let mut code = Self::default(); grammar.accept_visitor(&mut code); let code = &code; diff --git a/crates/solidity/outputs/cargo/build/src/main.rs b/crates/solidity/outputs/cargo/build/src/main.rs index 36790bfc75..48f1999d2b 100644 --- a/crates/solidity/outputs/cargo/build/src/main.rs +++ b/crates/solidity/outputs/cargo/build/src/main.rs @@ -20,7 +20,7 @@ fn main() -> Result<()> { let grammar = Grammar::from_dsl_v1(); let crate_dir = CargoWorkspace::locate_source_crate("slang_solidity")?; - CodeGenerator::write_source(&crate_dir.join("src/generated"), grammar)?; + CodeGenerator::write_source(&crate_dir.join("src/generated"), &grammar)?; } // This build script is not directly depended on by the caller source crate, so we need to manually diff --git a/crates/solidity/outputs/npm/build/src/main.rs b/crates/solidity/outputs/npm/build/src/main.rs index d7e25987e7..ab93f61f60 100644 --- a/crates/solidity/outputs/npm/build/src/main.rs +++ b/crates/solidity/outputs/npm/build/src/main.rs @@ -20,7 +20,7 @@ fn main() -> Result<()> { let grammar = Grammar::from_dsl_v1(); let crate_dir = CargoWorkspace::locate_source_crate("solidity_npm_crate")?; - CodeGenerator::write_source(&crate_dir.join("src/generated"), grammar)?; + CodeGenerator::write_source(&crate_dir.join("src/generated"), &grammar)?; } // This build script is not directly depended on by the caller source crate, so we need to manually