Skip to content

Commit d2d6e4b

Browse files
committed
fix: reduce binary size
1 parent 9492318 commit d2d6e4b

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

crates/rspack_fs/src/watcher/ignored.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ impl Debug for FsWatcherIgnored {
2727
/// Normalize the path by replacing backslashes with forward slashes.
2828
/// Smooth out the differences in the system, specifically for Windows
2929
fn normalize_path<'a>(path: &'a str) -> Cow<'a, str> {
30-
path.cow_replace("\\", "/")
30+
if cfg!(target_os = "windows") {
31+
path.cow_replace("\\", "/")
32+
} else {
33+
Cow::Borrowed(path)
34+
}
3135
}
3236

3337
impl FsWatcherIgnored {

crates/rspack_fs/src/watcher/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ pub enum FsEventKind {
3535

3636
#[derive(Debug, Clone, PartialEq, Eq)]
3737
pub(crate) struct FsEvent {
38-
pub path: ArcPath,
39-
pub kind: FsEventKind,
38+
pub(crate) path: ArcPath,
39+
pub(crate) kind: FsEventKind,
4040
}
4141

4242
/// `EventAggregateHandler` is a trait for handling aggregated file system events.

crates/rspack_fs/src/watcher/paths.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@ impl<'a> PathAccessor<'a> {
106106
/// by specifying which paths have been added and which have been removed. It holds vectors of paths to be
107107
/// added and removed, and provides functionality to apply these changes to a path tracker. This struct
108108
/// facilitates batch updates to the path sets, ensuring that additions and removals are processed efficiently.
109-
#[derive(Debug)]
110109
struct PathUpdater {
111110
pub added: Vec<ArcPath>,
112111
pub removed: Vec<ArcPath>,
@@ -146,7 +145,7 @@ impl PathUpdater {
146145
}
147146
}
148147

149-
#[derive(Debug, Default)]
148+
#[derive(Default)]
150149
/// `PathTracker` is responsible for tracking the state of file system paths for the watcher.
151150
///
152151
/// It maintains three sets:

0 commit comments

Comments
 (0)