Skip to content

Commit 268cabd

Browse files
committed
golf the code a little bit
1 parent 6720875 commit 268cabd

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/proxies/forwarded.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -244,20 +244,16 @@ impl<'a> Forwarded<'a> {
244244
rest = rest[1..].trim_start();
245245
}
246246

247-
Some(';') => {
248-
rest = &rest[1..];
249-
break;
250-
}
247+
// we have reached the end of the for= section
248+
Some(';') => return Ok(&rest[1..]),
251249

252-
// reached the end of the for section or the input
253-
None => break,
250+
// reached the end of the input
251+
None => return Ok(rest),
254252

255253
// bail
256254
_ => return Err(ParseError::new("unexpected character after for= section")),
257255
}
258256
}
259-
260-
Ok(rest)
261257
}
262258

263259
/// Transform a borrowed Forwarded into an owned

0 commit comments

Comments
 (0)