mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
cargo fmt
This commit is contained in:
parent
3d1b5b4c09
commit
9ad3faa331
4 changed files with 478 additions and 472 deletions
2
rewriter/rustfmt.toml
Normal file
2
rewriter/rustfmt.toml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
imports_granularity = "Crate"
|
||||||
|
hard_tabs = true
|
|
@ -60,8 +60,12 @@ fn encode_into<E>(
|
||||||
let mut pushed = false;
|
let mut pushed = false;
|
||||||
loop {
|
loop {
|
||||||
// Fast path to skip over safe chars at the beginning of the remaining string
|
// Fast path to skip over safe chars at the beginning of the remaining string
|
||||||
let ascii_len = data.iter()
|
let ascii_len = data
|
||||||
.take_while(|&&c| matches!(c, b'0'..=b'9' | b'A'..=b'Z' | b'a'..=b'z' | b'-' | b'.' | b'_' | b'~')).count();
|
.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() {
|
let (safe, rest) = if ascii_len >= data.len() {
|
||||||
if !pushed && may_skip_write {
|
if !pushed && may_skip_write {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue