Skip to content

Commit

Permalink
style: ignore clippy warnings on generated files
Browse files Browse the repository at this point in the history
  • Loading branch information
aelesbao committed Oct 30, 2024
1 parent f373d5d commit d54470f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/proto/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#[cfg(feature = "abstract-any")]
pub mod any;

#[allow(clippy::all)]
mod gen;

pub use gen::*;
Expand Down
9 changes: 5 additions & 4 deletions proto-build/src/commands/apply_patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use glob::glob;
use std::path::{Path, PathBuf};

/// Fix clashing type names in prost-generated code.
fn apply_cosmos_staking_patches(out_dir: &Path) {
fn apply_cosmos_staking_patches(out_dir: &Path) -> crate::Result<()> {
const REPLACEMENTS: &[(&str, &str)] = &[
("enum Validators", "enum Policy"),
(
Expand All @@ -12,8 +12,9 @@ fn apply_cosmos_staking_patches(out_dir: &Path) {
),
];

patch_file(&out_dir.join("cosmos.staking.v1beta1.rs"), REPLACEMENTS)
.expect("error patching cosmos.staking.v1beta1.rs");
patch_file(&out_dir.join("cosmos.staking.v1beta1.rs"), REPLACEMENTS)?;

Ok(())
}

pub fn apply_patches(out_dir: &Path) -> crate::Result<()> {
Expand Down Expand Up @@ -42,7 +43,7 @@ pub fn apply_patches(out_dir: &Path) -> crate::Result<()> {
patch_file(&src, REPLACEMENTS)?;
}

apply_cosmos_staking_patches(out_dir);
apply_cosmos_staking_patches(out_dir)?;

Ok(())
}

0 comments on commit d54470f

Please sign in to comment.