Skip to content

Commit

Permalink
style: cargo clippy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
aelesbao committed Oct 30, 2024
1 parent 2173d7f commit 3eef851
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions proto-build/src/commands/export.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ use std::path::Path;

pub fn export(submodules_dir: &Path, proto_dir: &Path) {
if proto_dir.exists() {
fs::remove_dir_all(&proto_dir).unwrap();
fs::remove_dir_all(proto_dir).unwrap();
}

run_buf_export(submodules_dir, ARCHWAY_DIR, &proto_dir).unwrap();
run_buf_export(submodules_dir, COSMOS_SDK_DIR, &proto_dir).unwrap();
run_buf_export(submodules_dir, IBC_DIR, &proto_dir).unwrap();
run_buf_export(submodules_dir, WASMD_DIR, &proto_dir).unwrap();
run_buf_export(submodules_dir, ARCHWAY_DIR, proto_dir).unwrap();
run_buf_export(submodules_dir, COSMOS_SDK_DIR, proto_dir).unwrap();
run_buf_export(submodules_dir, IBC_DIR, proto_dir).unwrap();
run_buf_export(submodules_dir, WASMD_DIR, proto_dir).unwrap();
}
2 changes: 1 addition & 1 deletion proto-build/src/commands/generate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pub fn generate(buf_gen_path: &Path, proto_path: &Path, out_dir: &Path) -> crate
println!("Generating proto...");

if out_dir.exists() {
fs::remove_dir_all(&out_dir).unwrap();
fs::remove_dir_all(out_dir).unwrap();
}

run_cmd(
Expand Down
2 changes: 1 addition & 1 deletion proto-build/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ mod parser;
mod utils;

use std::path::PathBuf;
use std::{io, path::Path, process};
use std::{io, path::Path};

use crate::commands::apply_patches::apply_patches;
use crate::commands::cleanup::cleanup;
Expand Down
4 changes: 2 additions & 2 deletions proto-build/src/parser/utils/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use proc_macro2::Span;
use syn::punctuated::Punctuated;
use syn::token::PathSep;
use syn::{
Field, Fields, FieldsNamed, GenericArgument, Ident, Item, ItemStruct, Path, PathArguments,
PathSegment, TraitBound, TraitBoundModifier, Type, TypeParam, TypeParamBound, TypePath,
Fields, FieldsNamed, Ident, Item, ItemStruct, Path, PathArguments,
PathSegment, Type, TypePath,
};

pub fn item_as_struct(item: &mut Item) -> Option<&mut ItemStruct> {
Expand Down
2 changes: 1 addition & 1 deletion proto-build/src/utils/patch_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::path::Path;
use std::{fs, io};

pub fn patch_file(path: &Path, replacements: &[(&str, &str)]) -> io::Result<()> {
let mut contents = fs::read_to_string(&path)?;
let mut contents = fs::read_to_string(path)?;

for &(regex, replacement) in replacements {
contents = Regex::new(regex)
Expand Down

0 comments on commit 3eef851

Please sign in to comment.