Skip to content

Commit

Permalink
fix(rspack_loader_runner): char_boundary panic when debug content (#6412
Browse files Browse the repository at this point in the history
)
  • Loading branch information
SoonIter committed May 6, 2024
1 parent 717e77d commit 0af97c6
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

2 comments on commit 0af97c6

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ“ Ran ecosystem CI: Open

suite result
modernjs, self-hosted, Linux, ci βœ… success
_selftest, ubuntu-latest βœ… success
nx, ubuntu-latest βœ… success
rspress, ubuntu-latest βœ… success
rsbuild, ubuntu-latest βœ… success
compat, ubuntu-latest βœ… success
examples, ubuntu-latest βœ… success

@rspack-bot
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ“ Benchmark detail: Open

task failure

Please sign in to comment.