Skip to content

Commit

Permalink
fix(rspack_loader_runner): char_boundary panic when debug
Browse files Browse the repository at this point in the history
  • Loading branch information
SoonIter committed Apr 30, 2024
1 parent ea79a64 commit 7fb8640
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion crates/rspack_loader_runner/src/content.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,10 @@ impl Debug for Content {
};

content
.field(ty, &s[0..usize::min(s.len(), 20)].to_owned())
.field(
ty,
&s[0..usize::min(s.len(), s.ceil_char_boundary(20))].to_owned(),
)
.finish()
}
}
1 change: 1 addition & 0 deletions crates/rspack_loader_runner/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#![feature(let_chains)]
#![feature(round_char_boundary)]

mod content;
mod loader;
Expand Down

0 comments on commit 7fb8640

Please sign in to comment.