Skip to content

refactor: remove unused code #10854

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

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
}

#[instrument(skip_all)]
#[allow(unused_variables)]
pub fn remove_available_modules(
compilation: &Compilation,
ordinal_by_modules: &IdentifierMap<u64>,
Expand All @@ -49,7 +48,7 @@
.map(|parents| parents.iter().copied().collect())
.collect();
let mut pending = HashSet::<usize>::default();
let module_graph = compilation.get_module_graph();

Check failure on line 51 in crates/rspack_core/src/build_chunk_graph/available_modules.rs

View workflow job for this annotation

GitHub Actions / Rust check

unused variable: `module_graph`

let mut stack = roots
.iter()
Expand Down
10 changes: 1 addition & 9 deletions crates/rspack_core/src/normal_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ use std::{
borrow::Cow,
hash::{BuildHasherDefault, Hash},
ptr::NonNull,
sync::{
atomic::{AtomicUsize, Ordering},
Arc,
},
sync::Arc,
};

use dashmap::DashMap;
Expand Down Expand Up @@ -137,8 +134,6 @@ pub struct NormalModule {
/// Generator options derived from [Rule.generator]
generator_options: Option<GeneratorOptions>,

#[allow(unused)]
debug_id: usize,
#[cacheable(with=AsMap)]
cached_source_sizes: DashMap<SourceType, f64, BuildHasherDefault<FxHasher>>,
#[cacheable(with=Skip)]
Expand All @@ -153,8 +148,6 @@ pub struct NormalModule {
parsed: bool,
}

static DEBUG_ID: AtomicUsize = AtomicUsize::new(1);

impl NormalModule {
fn create_id<'request>(
module_type: &ModuleType,
Expand Down Expand Up @@ -206,7 +199,6 @@ impl NormalModule {
resolve_options,
loaders,
source: None,
debug_id: DEBUG_ID.fetch_add(1, Ordering::Relaxed),

cached_source_sizes: DashMap::default(),
diagnostics: Default::default(),
Expand Down
Loading