Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Clippy happy #283

Merged
merged 2 commits into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions cargo-test-fuzz/patches/cw-plus.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
diff --git a/contracts/cw20-base/Cargo.toml b/contracts/cw20-base/Cargo.toml
index 0a15c6d..8a619ee 100644
index d9b40fd..676ff40 100644
--- a/contracts/cw20-base/Cargo.toml
+++ b/contracts/cw20-base/Cargo.toml
@@ -30,4 +30,6 @@ serde = { version = "1.0.103", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.23" }
@@ -30,4 +30,6 @@ serde = { version = "1.0.188", default-features = false, features = ["derive"] }
thiserror = { version = "1.0.49" }

+test-fuzz = { path = "../../../../test-fuzz" }
+
[dev-dependencies]
cw-multi-test = "0.16.1"
cw-multi-test = "0.16.5"
diff --git a/contracts/cw20-base/src/contract.rs b/contracts/cw20-base/src/contract.rs
index 02608ad..2317522 100644
index 30335e4..4c854af 100644
--- a/contracts/cw20-base/src/contract.rs
+++ b/contracts/cw20-base/src/contract.rs
@@ -92,7 +92,33 @@ fn verify_logo(logo: &Logo) -> Result<(), ContractError> {
Expand Down
12 changes: 6 additions & 6 deletions cargo-test-fuzz/patches/solana.patch
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ index 3e0553d..5136a8b 100644
pub struct AccountsDataMeter {
/// The initial amount of accounts data space used (in bytes)
diff --git a/program-runtime/src/compute_budget.rs b/program-runtime/src/compute_budget.rs
index 44fb070..547d338 100644
index f923922..0054d03 100644
--- a/program-runtime/src/compute_budget.rs
+++ b/program-runtime/src/compute_budget.rs
@@ -33,5 +33,5 @@ impl ::solana_frozen_abi::abi_example::AbiExample for ComputeBudget {
@@ -32,5 +32,5 @@ impl ::solana_frozen_abi::abi_example::AbiExample for ComputeBudget {
}

-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
Expand Down Expand Up @@ -188,10 +188,10 @@ index 16a52c0..e2683ac 100644
[dev-dependencies]
assert_matches = { workspace = true }
diff --git a/programs/bpf_loader/src/lib.rs b/programs/bpf_loader/src/lib.rs
index 9a91286..c68abaf 100644
index 82c6237..6abf051 100644
--- a/programs/bpf_loader/src/lib.rs
+++ b/programs/bpf_loader/src/lib.rs
@@ -371,6 +371,7 @@ pub fn process_instruction(
@@ -388,6 +388,7 @@ pub fn process_instruction(
}

-fn process_instruction_inner(
Expand Down Expand Up @@ -220,10 +220,10 @@ index 061b16c..3d02d73 100644
[target.'cfg(target_arch = "wasm32")'.dependencies]
js-sys = { workspace = true }
diff --git a/sdk/src/feature_set.rs b/sdk/src/feature_set.rs
index 418d328..345ffc9 100644
index b414a5f..47ad755 100644
--- a/sdk/src/feature_set.rs
+++ b/sdk/src/feature_set.rs
@@ -900,5 +900,5 @@ lazy_static! {
@@ -909,5 +909,5 @@ lazy_static! {

/// `FeatureSet` holds the set of currently active/inactive runtime features
-#[derive(AbiExample, Debug, Clone, Eq, PartialEq)]
Expand Down
4 changes: 2 additions & 2 deletions cargo-test-fuzz/tests/third_party.rs
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ fn run_test(module_path: &str, test: &Test, no_run: bool) {
])
.logged_assert()
.success()
.stdout(predicate::str::is_match(r#"(?m)^[[:xdigit:]]{40}:"#).unwrap());
.stdout(predicate::str::is_match(r"(?m)^[[:xdigit:]]{40}:").unwrap());

Command::cargo_bin("cargo-test-fuzz")
.unwrap()
Expand Down Expand Up @@ -225,7 +225,7 @@ fn check_test_fuzz_dependency(subdir: &Path, test_package: &str) {
.packages
.iter()
.find(|package| package.name == test_package)
.unwrap_or_else(|| panic!("Could not find package `{}`", test_package));
.unwrap_or_else(|| panic!("Could not find package `{test_package}`"));
let dep = package
.dependencies
.iter()
Expand Down
4 changes: 2 additions & 2 deletions cargo-test-fuzz/third_party.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
"flags": [],
"url": "https://github.com/CosmWasm/cw-plus",
"rev": "362423321cfd16ba51590a90413a048e47e1063a",
"rev": "49a2ed0a4df46a7100e4f5d65bd8cfd4cd90db5f",
"patch": "cw-plus.patch",
"subdir": ".",
"package": "cw20-base",
Expand All @@ -29,7 +29,7 @@
{
"flags": ["EXPENSIVE", "SKIP"],
"url": "https://github.com/solana-labs/solana",
"rev": "1e1e29641499e08ea1516ba2d81344e7875abc52",
"rev": "3508b7d84ee3d05107c908ff2bb4772f3524e22e",
"patch": "solana.patch",
"subdir": ".",
"package": "solana-bpf-loader-program",
Expand Down
2 changes: 1 addition & 1 deletion internal/src/dirs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ fn path_from_args_type<T>() -> String {
let type_name = type_name::<T>();
let n = type_name
.find("_fuzz")
.unwrap_or_else(|| panic!("unexpected type name: `{}`", type_name));
.unwrap_or_else(|| panic!("unexpected type name: `{type_name}`"));
type_name[..n].to_owned()
}

Expand Down
2 changes: 1 addition & 1 deletion macro/src/auto_concretize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ mod functions {
|| Err(Kind::None),
|path| {
Ok(read_to_string(&path)
.unwrap_or_else(|_| panic!("`read_to_string` failed for `{:?}`", path)))
.unwrap_or_else(|_| panic!("`read_to_string` failed for `{path:?}`")))
},
)
}
Expand Down
6 changes: 3 additions & 3 deletions macro/src/mod_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ fn contains(left: Span, right: Span) -> bool {
pub fn module_path(span: Span) -> Vec<Ident> {
let source = span.source_file();
let path = source.path();
let contents = read_to_string(&path)
.unwrap_or_else(|_| panic!("`read_to_string` failed for `{:?}`", path));
let contents =
read_to_string(&path).unwrap_or_else(|_| panic!("`read_to_string` failed for `{path:?}`"));
let file: File =
parse_str(&contents).unwrap_or_else(|_| panic!("Could not parse `{:?}` contents", source));
parse_str(&contents).unwrap_or_else(|_| panic!("Could not parse `{source:?}` contents"));
let mut visitor = ModVisitor {
target: span,
stack: Vec::new(),
Expand Down