Skip to content

Commit 3e3e2aa

Browse files
committed
Add comment for unsafe block in percent_encoding
1 parent 10163c7 commit 3e3e2aa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

percent_encoding/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,8 @@ impl<'a> Iterator for PercentEncode<'a> {
252252
self.bytes = remaining;
253253
Some(percent_encode_byte(first_byte))
254254
} else {
255+
// The unsafe blocks here are appropriate because the bytes are
256+
// confirmed as a subset of UTF-8 in should_percent_encode.
255257
for (i, &byte) in remaining.iter().enumerate() {
256258
if self.ascii_set.should_percent_encode(byte) {
257259
// 1 for first_byte + i for previous iterations of this loop

0 commit comments

Comments
 (0)