Unverified Commit b951e6ff authored by Robin Freyler's avatar Robin Freyler Committed by GitHub
Browse files

Fix or silence some more clippy warnings (#954)

* fix some clippy warnings

* apply rustfmt

* add ink_engine to PURELY_STD_CRATES list in GitLab CI
parent e45aeb23
Pipeline #161394 failed with stages
in 9 minutes and 28 seconds
......@@ -19,7 +19,7 @@ variables:
CARGO_INCREMENTAL: 0
CARGO_TARGET_DIR: "/ci-cache/${CI_PROJECT_NAME}/targets/${CI_COMMIT_REF_NAME}/${CI_JOB_NAME}"
CI_IMAGE: "paritytech/ink-ci-linux:production"
PURELY_STD_CRATES: "lang/codegen metadata"
PURELY_STD_CRATES: "lang/codegen metadata engine"
ALSO_WASM_CRATES: "env storage storage/derive allocator prelude primitives lang lang/macro lang/ir"
# this var is changed to "-:staging" when the CI image gets rebuilt
# read more https://github.com/paritytech/scripts/pull/244
......
......@@ -147,10 +147,7 @@ mod tests {
assert_eq!(database.get(&key1), None);
assert_eq!(database.insert(key1.clone(), val1.clone()), None);
assert_eq!(database.get(&key1), Some(&val1));
assert_eq!(
database.insert(key1.clone(), val2.clone()),
Some(val1.clone())
);
assert_eq!(database.insert(key1.clone(), val2.clone()), Some(val1));
assert_eq!(database.get(&key1), Some(&val2));
assert_eq!(database.insert(key2.clone(), val3.clone()), None);
assert_eq!(database.len(), 2);
......@@ -182,7 +179,7 @@ mod tests {
);
assert_eq!(
storage.insert_into_contract_storage(&account_id, &key1, val2.clone()),
Some(val1.clone())
Some(val1)
);
assert_eq!(
storage.get_from_contract_storage(&account_id, &key1),
......
......@@ -84,11 +84,7 @@ fn bench_populated_cache(c: &mut Criterion) {
let mut group = c.benchmark_group("Bench: populated cache");
group.bench_function("fill_bitstash", |b| b.iter(populated_cache::fill_bitstash));
group.bench_function("one_put", |b| {
b.iter_batched_ref(
create_large_stash,
|stash| one_put(stash),
BatchSize::SmallInput,
)
b.iter_batched_ref(create_large_stash, one_put, BatchSize::SmallInput)
});
group.finish();
}
......@@ -120,7 +116,7 @@ fn bench_empty_cache(c: &mut Criterion) {
push_stash_by_ref(&stash);
pull_stash()
},
|stash| one_put(stash),
one_put,
BatchSize::SmallInput,
)
});
......
......@@ -12,6 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// The `synstructure` crate currently expands to code that has a single
// `panic` inside an `if` block. We have to allow the following `clippy`
// lint until the fixing PR has been merged:
// PR: https://github.com/mystor/synstructure/pull/50
#![allow(clippy::if_then_panic)]
use crate::packed_layout_derive;
#[test]
......
......@@ -12,6 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// The `synstructure` crate currently expands to code that has a single
// `panic` inside an `if` block. We have to allow the following `clippy`
// lint until the fixing PR has been merged:
// PR: https://github.com/mystor/synstructure/pull/50
#![allow(clippy::if_then_panic)]
// These tests are partly testing if code is expanded correctly.
// Hence the syntax contains a number of verbose statements which
// are not properly cleaned up.
......
......@@ -12,6 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
// The `synstructure` crate currently expands to code that has a single
// `panic` inside an `if` block. We have to allow the following `clippy`
// lint until the fixing PR has been merged:
// PR: https://github.com/mystor/synstructure/pull/50
#![allow(clippy::if_then_panic)]
use crate::storage_layout_derive;
#[test]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment