cargo fmt

This commit is contained in:
Toshit Chawda 2024-07-29 22:18:07 -07:00
parent 3d1b5b4c09
commit 9ad3faa331
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
4 changed files with 478 additions and 472 deletions

2
rewriter/rustfmt.toml Normal file
View file

@ -0,0 +1,2 @@
imports_granularity = "Crate"
hard_tabs = true

View file

@ -60,8 +60,12 @@ fn encode_into<E>(
let mut pushed = false;
loop {
// Fast path to skip over safe chars at the beginning of the remaining string
let ascii_len = data.iter()
.take_while(|&&c| matches!(c, b'0'..=b'9' | b'A'..=b'Z' | b'a'..=b'z' | b'-' | b'.' | b'_' | b'~')).count();
let ascii_len = data
.iter()
.take_while(
|&&c| matches!(c, b'0'..=b'9' | b'A'..=b'Z' | b'a'..=b'z' | b'-' | b'.' | b'_' | b'~'),
)
.count();
let (safe, rest) = if ascii_len >= data.len() {
if !pushed && may_skip_write {