Skip to content

Commit

Permalink
Use while let (RustCrypto#10)
Browse files Browse the repository at this point in the history
Loop is more readable as a 'while let'.
  • Loading branch information
luisbg authored and newpavlov committed Oct 3, 2018
1 parent e4d0563 commit c68c528
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions hex-literal/hex-literal-impl/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ proc_macro_expr_impl! {

s.push('[');
let mut iter = input.chars().filter(is_hex_char);
loop {
let c1 = match iter.next() { Some(c) => c, None => break };
while let Some(c1) = iter.next() {
if let Some(c2) = iter.next() {
s += "0x";
s.push(c1);
Expand Down

0 comments on commit c68c528

Please sign in to comment.