Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
drahnr committed Feb 6, 2025
1 parent 51f75d5 commit 2a31785
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions crates/binding/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
use std::io::Write;
use std::path::PathBuf;

const SKIP_ENV_VAR_NAME: &'static str = "SKIP_BINDING_GENERATION";
const SKIP_ENV_VAR_NAME: &str = "SKIP_BINDING_GENERATION";
/// Generate Rust bindings from the IPC Solidity Actors ABI artifacts.
///p
/// These are built by `make ipc-actors-abi`, here we just add the final step
Expand All @@ -30,7 +30,7 @@ fn main() -> color_eyre::Result<()> {
// Enabled by default so that in the monorepo we don't have to worry about stale code.
if let Ok(val) = std::env::var(SKIP_ENV_VAR_NAME) {
let val = val.trim();
if val == "true" || val == "1" || val == "" {
if val == "true" || val == "1" || val.is_empty() {
println!(
"cargo:warn=Skipping binding generation since {} is set by the user",
SKIP_ENV_VAR_NAME
Expand Down Expand Up @@ -61,7 +61,7 @@ fn main() -> color_eyre::Result<()> {
lib,
"//! This file was generated by build.rs and will be overriden"
)?;
writeln!(lib, "")?;
writeln!(lib)?;
writeln!(lib, "#[macro_use]")?;
writeln!(lib, "mod convert;")?;

Expand Down Expand Up @@ -116,7 +116,7 @@ fn main() -> color_eyre::Result<()> {
writeln!(lib, "#[allow(clippy::all)]")?;
writeln!(lib, "pub mod {module_name};")?;
}
writeln!(lib, "")?;
writeln!(lib)?;
writeln!(
lib,
"// The list of contracts need to convert FvmAddress to fvm_shared::Address"
Expand All @@ -137,7 +137,7 @@ fn main() -> color_eyre::Result<()> {
writeln!(lib, "fvm_address_conversion!({module});")?;
}

writeln!(lib, "")?;
writeln!(lib)?;

writeln!(
lib,
Expand All @@ -164,7 +164,7 @@ fn main() -> color_eyre::Result<()> {
let unformatted = fs_err::read_to_string(&lib_path)?;
let f = syn::parse_str(&unformatted)?;
let c = prettyplease::unparse(&f);
fs_err::write(&lib_path, c.as_str().as_bytes())?;
fs_err::write(&lib_path, c.as_bytes())?;

Ok(())
}
Expand Down

0 comments on commit 2a31785

Please sign in to comment.