Skip to content

Commit b8f5cf8

Browse files
committed
Remove the unnecessary helper
1 parent 5e0ecfe commit b8f5cf8

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

src/parse.rs

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -167,29 +167,20 @@ impl<'a> Reader<'a> {
167167
// FIXME: This makes things faster but causes significant bloat.
168168
#[inline(always)]
169169
fn read<E: Encoder>(&mut self) -> Result<bool> {
170-
struct Helper<E: Encoder> {
171-
_marker: PhantomData<E>,
172-
}
173-
174-
impl<E: Encoder> Helper<E> {
175-
const ALLOWS_PCT_ENCODED: bool = E::TABLE.allows_pct_encoded();
176-
const ALLOWS_NON_ASCII: bool = E::TABLE.allows_non_ascii();
177-
}
178-
179170
let start = self.pos;
180171
let mut i = self.pos;
181172

182173
while i < self.len() {
183174
let x = self.bytes[i];
184-
if Helper::<E>::ALLOWS_PCT_ENCODED && x == b'%' {
175+
if E::TABLE.allows_pct_encoded() && x == b'%' {
185176
let [hi, lo, ..] = self.bytes[i + 1..] else {
186177
return self.invalid_pct();
187178
};
188179
if !pct_enc::is_hexdig_pair(hi, lo) {
189180
return self.invalid_pct();
190181
}
191182
i += 3;
192-
} else if Helper::<E>::ALLOWS_NON_ASCII {
183+
} else if E::TABLE.allows_non_ascii() {
193184
let (x, len) = utf8::next_code_point(self.bytes, i);
194185
if !E::TABLE.allows_code_point(x) {
195186
break;

0 commit comments

Comments
 (0)