Skip to content

Commit dfbe07a

Browse files
committed
manually fix clippy and deny
1 parent aba8192 commit dfbe07a

File tree

4 files changed

+13
-44
lines changed

4 files changed

+13
-44
lines changed

crates/hstr/benches/libs.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ extern crate swc_malloc;
44

55
#[macro_use]
66
extern crate criterion;
7-
use std::{hash::Hash, mem::forget};
8-
7+
use std::{hash::Hash, mem::forget, hint::black_box};
98
use compact_str::CompactString;
10-
use criterion::{black_box, BatchSize, BenchmarkId, Criterion};
9+
use criterion::{BatchSize, BenchmarkId, Criterion};
1110
use par_iter::prelude::*;
12-
use rand::distributions::{Alphanumeric, DistString};
11+
use rand::distr::{Alphanumeric, SampleString};
1312
use rustc_hash::FxHashSet;
1413
use smartstring::{LazyCompact, SmartString};
1514

@@ -326,5 +325,5 @@ criterion_group!(
326325
criterion_main!(benches);
327326

328327
fn random_string(len: usize) -> String {
329-
Alphanumeric.sample_string(&mut rand::thread_rng(), len)
328+
Alphanumeric.sample_string(&mut rand::rng(), len)
330329
}

crates/swc_ecma_compat_es2015/src/classes/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,7 @@ impl Classes {
937937
}
938938

939939
#[tracing::instrument(level = "debug", skip_all)]
940+
#[allow(dead_code)]
940941
fn inject_class_call_check(c: &mut Vec<Stmt>, name: Ident) {
941942
let mut class_name_sym = name.clone();
942943
class_name_sym.span = DUMMY_SP;
@@ -958,6 +959,7 @@ fn inject_class_call_check(c: &mut Vec<Stmt>, name: Ident) {
958959

959960
/// Returns true if no `super` is used before `super()` call.
960961
#[tracing::instrument(level = "debug", skip_all)]
962+
#[allow(dead_code)]
961963
fn is_always_initialized(body: &[Stmt]) -> bool {
962964
struct SuperFinder {
963965
found: bool,

crates/swc_plugin_backend_wasmer/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ static ENGINE: Lazy<Mutex<wasmer::Engine>> = Lazy::new(|| {
2525
// Use empty enumset to disable simd.
2626
use enumset::EnumSet;
2727
use wasmer::sys::{BaseTunables, CompilerConfig, EngineBuilder, Target, Triple};
28-
let set = EnumSet::new();
2928

3029
// [TODO]: Should we use is_x86_feature_detected! macro instead?
3130
#[cfg(target_arch = "x86_64")]
32-
set.insert(wasmer::sys::CpuFeature::SSE2);
33-
let target = Target::new(Triple::host(), set);
31+
let target = Target::new(Triple::host(), EnumSet::only(wasmer::sys::CpuFeature::SSE2));
32+
#[cfg(not(target_arch = "x86_64"))]
33+
let target = Target::new(Triple::host(), EnumSet::new());
3434

3535
let config = wasmer_compiler_cranelift::Cranelift::default();
3636
let mut engine = EngineBuilder::new(Box::new(config) as Box<dyn CompilerConfig>)

deny.toml

Lines changed: 4 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
# this list would mean the nix crate, as well as any of its exclusive
1818
# dependencies not shared by any other crates, would be ignored, as the target
1919
# list here is effectively saying which targets you are building for.
20+
[graph]
2021
targets = []
2122

2223
# This section is considered when running `cargo deny check advisories`
@@ -27,39 +28,24 @@ targets = []
2728
db-path = "~/.cargo/advisory-db"
2829
# The url(s) of the advisory databases to use
2930
db-urls = ["https://github.com/rustsec/advisory-db"]
30-
# The lint level for security vulnerabilities
31-
vulnerability = "deny"
3231
# The lint level for unmaintained crates
33-
unmaintained = "warn"
32+
unmaintained = "workspace"
3433
# The lint level for crates that have been yanked from their source registry
3534
yanked = "warn"
36-
# The lint level for crates with security notices. Note that as of
37-
# 2019-12-17 there are no security notice advisories in
38-
# https://github.com/rustsec/advisory-db
39-
notice = "warn"
4035
# A list of advisory IDs to ignore. Note that ignored advisories will still
4136
# output a note when they are encountered.
4237
ignore = [
4338
#"RUSTSEC-0000-0000",
4439
"RUSTSEC-2020-0071",
4540
"RUSTSEC-2020-0159",
41+
"RUSTSEC-2021-0139", # unmaintained: ansi_term 0.12.1
42+
"RUSTSEC-2020-0095", # unmaintained: difference 2.0.0
4643
]
47-
# Threshold for security vulnerabilities, any vulnerability with a CVSS score
48-
# lower than the range specified will be ignored. Note that ignored advisories
49-
# will still output a note when they are encountered.
50-
# * None - CVSS Score 0.0
51-
# * Low - CVSS Score 0.1 - 3.9
52-
# * Medium - CVSS Score 4.0 - 6.9
53-
# * High - CVSS Score 7.0 - 8.9
54-
# * Critical - CVSS Score 9.0 - 10.0
55-
#severity-threshold =
5644

5745
# This section is considered when running `cargo deny check licenses`
5846
# More documentation for the licenses section can be found here:
5947
# https://embarkstudios.github.io/cargo-deny/checks/licenses/cfg.html
6048
[licenses]
61-
# The lint level for crates which do not have a detectable license
62-
unlicensed = "deny"
6349
# List of explictly allowed licenses
6450
# See https://spdx.org/licenses/ for list of possible licenses
6551
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
@@ -80,24 +66,6 @@ allow = [
8066
"BSL-1.0", #xxhash-rust
8167
"Unicode-3.0",
8268
]
83-
# List of explictly disallowed licenses
84-
# See https://spdx.org/licenses/ for list of possible licenses
85-
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
86-
deny = []
87-
# Lint level for licenses considered copyleft
88-
copyleft = "deny"
89-
# Blanket approval or denial for OSI-approved or FSF Free/Libre licenses
90-
# * both - The license will be approved if it is both OSI-approved *AND* FSF
91-
# * either - The license will be approved if it is either OSI-approved *OR* FSF
92-
# * osi-only - The license will be approved if is OSI-approved *AND NOT* FSF
93-
# * fsf-only - The license will be approved if is FSF *AND NOT* OSI-approved
94-
# * neither - This predicate is ignored and the default lint level is used
95-
allow-osi-fsf-free = "neither"
96-
# Lint level used when no other predicates are matched
97-
# 1. License isn't in the allow or deny lists
98-
# 2. License isn't copyleft
99-
# 3. License isn't OSI/FSF, or allow-osi-fsf-free = "neither"
100-
default = "deny"
10169
# The confidence threshold for detecting a license from license text.
10270
# The higher the value, the more closely the license text must be to the
10371
# canonical license text of a valid SPDX license file.

0 commit comments

Comments
 (0)