]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/issue-1468.rs
Merge commit 'd822110d3b5625b9dc80ccc442e06fc3cc851d76' into clippyup
[rust.git] / src / tools / rustfmt / tests / target / issue-1468.rs
1 fn issue1468() {
2     euc_jp_decoder_functions!({
3         let trail_minus_offset = byte.wrapping_sub(0xA1);
4         // Fast-track Hiragana (60% according to Lunde)
5         // and Katakana (10% according to Lunde).
6         if jis0208_lead_minus_offset == 0x03 && trail_minus_offset < 0x53 {
7             // Hiragana
8             handle.write_upper_bmp(0x3041 + trail_minus_offset as u16)
9         } else if jis0208_lead_minus_offset == 0x04 && trail_minus_offset < 0x56 {
10             // Katakana
11             handle.write_upper_bmp(0x30A1 + trail_minus_offset as u16)
12         } else if trail_minus_offset > (0xFE - 0xA1) {
13             if byte < 0x80 {
14                 return (
15                     DecoderResult::Malformed(1, 0),
16                     unread_handle_trail.unread(),
17                     handle.written(),
18                 );
19             }
20             return (
21                 DecoderResult::Malformed(2, 0),
22                 unread_handle_trail.consumed(),
23                 handle.written(),
24             );
25         } else {
26             unreachable!();
27         }
28     });
29 }