Commit graph

275 commits

Author SHA1 Message Date
David Tolnay
b1cc5567b2
Fix heap buffer overflow in yaml_emitter_emit_flow_mapping_key 2022-07-27 18:10:48 -07:00
David Tolnay
90b50bb321
Remove unneeded _usize integer suffix 2022-07-27 18:10:48 -07:00
David Tolnay
5132ad2a57
Merge pull request #11 from dtolnay/cintcast
Remove some needless libc::c_int casts
2022-07-27 18:10:42 -07:00
David Tolnay
8f5738e829
Remove some needless libc::c_int casts 2022-07-27 18:04:55 -07:00
David Tolnay
085e3af17f
Merge pull request #10 from dtolnay/enums
Remove integer casts from enum comparisons
2022-07-27 18:04:46 -07:00
David Tolnay
326db391d8
Resolve needless_return clippy lints
error: unneeded `return` statement
       --> src/emitter.rs:253:41
        |
    253 |         YAML_EMIT_STREAM_START_STATE => return yaml_emitter_emit_stream_start(emitter, event),
        |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_stream_start(emitter, event)`
        |
        = note: `-D clippy::needless-return` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:255:13
        |
    255 |             return yaml_emitter_emit_document_start(emitter, event, true)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_document_start(emitter, event, true)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:258:13
        |
    258 |             return yaml_emitter_emit_document_start(emitter, event, false)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_document_start(emitter, event, false)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:261:13
        |
    261 |             return yaml_emitter_emit_document_content(emitter, event)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_document_content(emitter, event)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:263:41
        |
    263 |         YAML_EMIT_DOCUMENT_END_STATE => return yaml_emitter_emit_document_end(emitter, event),
        |                                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_document_end(emitter, event)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:265:13
        |
    265 |             return yaml_emitter_emit_flow_sequence_item(emitter, event, true)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_flow_sequence_item(emitter, event, true)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:268:13
        |
    268 |             return yaml_emitter_emit_flow_sequence_item(emitter, event, false)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_flow_sequence_item(emitter, event, false)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:271:13
        |
    271 |             return yaml_emitter_emit_flow_mapping_key(emitter, event, true)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_flow_mapping_key(emitter, event, true)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:274:13
        |
    274 |             return yaml_emitter_emit_flow_mapping_key(emitter, event, false)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_flow_mapping_key(emitter, event, false)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:277:13
        |
    277 |             return yaml_emitter_emit_flow_mapping_value(emitter, event, true)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_flow_mapping_value(emitter, event, true)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:280:13
        |
    280 |             return yaml_emitter_emit_flow_mapping_value(emitter, event, false)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_flow_mapping_value(emitter, event, false)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:283:13
        |
    283 |             return yaml_emitter_emit_block_sequence_item(emitter, event, true)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_block_sequence_item(emitter, event, true)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:286:13
        |
    286 |             return yaml_emitter_emit_block_sequence_item(emitter, event, false)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_block_sequence_item(emitter, event, false)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:289:13
        |
    289 |             return yaml_emitter_emit_block_mapping_key(emitter, event, true)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_block_mapping_key(emitter, event, true)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:292:13
        |
    292 |             return yaml_emitter_emit_block_mapping_key(emitter, event, false)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_block_mapping_key(emitter, event, false)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:295:13
        |
    295 |             return yaml_emitter_emit_block_mapping_value(emitter, event, true)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_block_mapping_value(emitter, event, true)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:298:13
        |
    298 |             return yaml_emitter_emit_block_mapping_value(emitter, event, false)
        |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: remove `return`: `yaml_emitter_emit_block_mapping_value(emitter, event, false)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return

    error: unneeded `return` statement
       --> src/emitter.rs:301:13
        |
    301 | /             return yaml_emitter_set_emitter_error(
    302 | |                 emitter,
    303 | |                 b"expected nothing after STREAM-END\0" as *const u8 as *const libc::c_char,
    304 | |             )
        | |_____________^
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_return
    help: remove `return`
        |
    301 ~             yaml_emitter_set_emitter_error(
    302 +                 emitter,
    303 +                 b"expected nothing after STREAM-END\0" as *const u8 as *const libc::c_char,
    304 +             )
        |
2022-07-27 17:55:37 -07:00
David Tolnay
aada00c078
Remove integer casts from enum comparisons 2022-07-27 17:53:11 -07:00
David Tolnay
ae6115c02c
Release 0.2.0 2022-07-23 15:19:51 -07:00
David Tolnay
f77851265b
Merge pull request #8 from dtolnay/handler
Disallow None handler function argument
2022-07-23 15:19:00 -07:00
David Tolnay
6d45d7c9a5
Disallow None handler function argument 2022-07-23 15:12:41 -07:00
David Tolnay
cf82ce23b9
Merge pull request #7 from dtolnay/getversion
Delete get_version APIs
2022-07-23 15:12:34 -07:00
David Tolnay
4fa84c1ef9
Delete get_version APIs 2022-07-23 15:05:07 -07:00
David Tolnay
8a8ec2ffa3
Merge pull request #6 from dtolnay/bool
Replace c_int -> bool for 0/1 valued booleans
2022-07-23 14:58:00 -07:00
David Tolnay
692ad8bc18
Ignore fn_params_excessive_bools pedantic clippy lint
warning: more than 3 bools in function parameters
       --> src/emitter.rs:975:1
        |
    975 | / unsafe fn yaml_emitter_emit_node(
    976 | |     mut emitter: *mut yaml_emitter_t,
    977 | |     event: *mut yaml_event_t,
    978 | |     root: bool,
    ...   |
    997 | |     }
    998 | | }
        | |_^
        |
    note: the lint level is defined here
       --> src/lib.rs:10:9
        |
    10  | #![warn(clippy::pedantic)]
        |         ^^^^^^^^^^^^^^^^
        = note: `#[warn(clippy::fn_params_excessive_bools)]` implied by `#[warn(clippy::pedantic)]`
        = help: consider refactoring bools into two-variant enums
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#fn_params_excessive_bools
2022-07-23 14:51:55 -07:00
David Tolnay
2c89cfb523
Replace c_int -> bool for 0/1 valued booleans 2022-07-23 14:50:57 -07:00
David Tolnay
3bbac47098
Remove unneeded integer suffixes 2022-07-23 14:02:15 -07:00
David Tolnay
62849551dd
Change all hex number literals to uppercase 2022-07-23 13:58:48 -07:00
David Tolnay
668328a578
Ignore manual_range_contains clippy lint
error: manual `RangeInclusive::contains` implementation
       --> src/reader.rs:286:28
        |
    286 |                         if value >= 0xd800_u32 && value <= 0xdfff_u32
        |                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0xd800_u32..=0xdfff_u32).contains(&value)`
        |
        = note: `-D clippy::manual-range-contains` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains

    error: manual `RangeInclusive::contains` implementation
       --> src/reader.rs:391:20
        |
    391 |                 || value >= 0x20_u32 && value <= 0x7e_u32
        |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x20_u32..=0x7e_u32).contains(&value)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains

    error: manual `RangeInclusive::contains` implementation
       --> src/reader.rs:393:20
        |
    393 |                 || value >= 0xa0_u32 && value <= 0xd7ff_u32
        |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0xa0_u32..=0xd7ff_u32).contains(&value)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains

    error: manual `RangeInclusive::contains` implementation
       --> src/reader.rs:394:20
        |
    394 |                 || value >= 0xe000_u32 && value <= 0xfffd_u32
        |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0xe000_u32..=0xfffd_u32).contains(&value)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains

    error: manual `RangeInclusive::contains` implementation
       --> src/reader.rs:395:20
        |
    395 |                 || value >= 0x10000_u32 && value <= 0x10ffff_u32)
        |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use: `(0x10000_u32..=0x10ffff_u32).contains(&value)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains

    error: manual `RangeInclusive::contains` implementation
        --> src/scanner.rs:2611:48
         |
    2611 |   ...                   if value >= 0xd800_u32
         |  __________________________^
    2612 | | ...                       && value <= 0xdfff_u32
         | |________________________________________________^ help: use: `(0xd800_u32..=0xdfff_u32).contains(&value)`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
2022-07-23 13:50:33 -07:00
David Tolnay
c7128fbccf
Resolve unnecessary_cast clippy lints
error: casting integer literal to `u32` is unnecessary
       --> src/api.rs:624:43
        |
    624 |             || width == 2_u32 && value >= 0x80 as libc::c_uint
        |                                           ^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
        |
        = note: `-D clippy::unnecessary-cast` implied by `-D clippy::all`
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/api.rs:625:43
        |
    625 |             || width == 3_u32 && value >= 0x800 as libc::c_uint
        |                                           ^^^^^^^^^^^^^^^^^^^^^ help: try: `0x800_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/api.rs:626:43
        |
    626 |             || width == 4_u32 && value >= 0x10000 as libc::c_uint)
        |                                           ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x10000_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/emitter.rs:2209:35
         |
    2209 |                     if value_0 <= 0xff as libc::c_uint {
         |                                   ^^^^^^^^^^^^^^^^^^^^ help: try: `0xff_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/emitter.rs:2214:42
         |
    2214 |                     } else if value_0 <= 0xffff as libc::c_uint {
         |                                          ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xffff_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:274:59
        |
    274 | ...                   || width == 2_u32 && value >= 0x80 as libc::c_uint
        |                                                     ^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:275:59
        |
    275 | ...                   || width == 3_u32 && value >= 0x800 as libc::c_uint
        |                                                     ^^^^^^^^^^^^^^^^^^^^^ help: try: `0x800_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:276:59
        |
    276 | ...                   || width == 4_u32 && value >= 0x10000 as libc::c_uint)
        |                                                     ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x10000_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:286:37
        |
    286 |                         if value >= 0xd800 as libc::c_uint && value <= 0xdfff as libc::c_uint
        |                                     ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xd800_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:286:72
        |
    286 |                         if value >= 0xd800 as libc::c_uint && value <= 0xdfff as libc::c_uint
        |                                                                        ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xdfff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:287:40
        |
    287 | ...                   || value > 0x10ffff as libc::c_uint
        |                                  ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x10ffff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:330:36
        |
    330 |                         if value & 0xfc00 as libc::c_uint == 0xdc00 as libc::c_uint {
        |                                    ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xfc00_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:330:62
        |
    330 |                         if value & 0xfc00 as libc::c_uint == 0xdc00 as libc::c_uint {
        |                                                              ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xdc00_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:339:36
        |
    339 |                         if value & 0xfc00 as libc::c_uint == 0xd800 as libc::c_uint {
        |                                    ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xfc00_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:339:62
        |
    339 |                         if value & 0xfc00 as libc::c_uint == 0xd800 as libc::c_uint {
        |                                                              ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xd800_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:365:45
        |
    365 | ...                   if value2 & 0xfc00 as libc::c_uint != 0xdc00 as libc::c_uint {
        |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xfc00_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:365:71
        |
    365 | ...                   if value2 & 0xfc00 as libc::c_uint != 0xdc00 as libc::c_uint {
        |                                                             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xdc00_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:374:41
        |
    374 | ...                   value = (0x10000 as libc::c_uint)
        |                               ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x10000_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:375:60
        |
    375 | ...                   .wrapping_add((value & 0x3ff as libc::c_uint) << 10)
        |                                              ^^^^^^^^^^^^^^^^^^^^^ help: try: `0x3ff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:376:60
        |
    376 | ...                   .wrapping_add(value2 & 0x3ff as libc::c_uint);
        |                                              ^^^^^^^^^^^^^^^^^^^^^ help: try: `0x3ff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:388:27
        |
    388 |             if !(value == 0x9 as libc::c_uint
        |                           ^^^^^^^^^^^^^^^^^^^ help: try: `0x9_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:389:29
        |
    389 |                 || value == 0xa as libc::c_uint
        |                             ^^^^^^^^^^^^^^^^^^^ help: try: `0xa_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:390:29
        |
    390 |                 || value == 0xd as libc::c_uint
        |                             ^^^^^^^^^^^^^^^^^^^ help: try: `0xd_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:391:29
        |
    391 |                 || value >= 0x20 as libc::c_uint && value <= 0x7e as libc::c_uint
        |                             ^^^^^^^^^^^^^^^^^^^^ help: try: `0x20_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:391:62
        |
    391 |                 || value >= 0x20 as libc::c_uint && value <= 0x7e as libc::c_uint
        |                                                              ^^^^^^^^^^^^^^^^^^^^ help: try: `0x7e_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:392:29
        |
    392 |                 || value == 0x85 as libc::c_uint
        |                             ^^^^^^^^^^^^^^^^^^^^ help: try: `0x85_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:393:29
        |
    393 |                 || value >= 0xa0 as libc::c_uint && value <= 0xd7ff as libc::c_uint
        |                             ^^^^^^^^^^^^^^^^^^^^ help: try: `0xa0_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:393:62
        |
    393 |                 || value >= 0xa0 as libc::c_uint && value <= 0xd7ff as libc::c_uint
        |                                                              ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xd7ff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:394:29
        |
    394 |                 || value >= 0xe000 as libc::c_uint && value <= 0xfffd as libc::c_uint
        |                             ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xe000_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:394:64
        |
    394 |                 || value >= 0xe000 as libc::c_uint && value <= 0xfffd as libc::c_uint
        |                                                                ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xfffd_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:395:29
        |
    395 |                 || value >= 0x10000 as libc::c_uint && value <= 0x10ffff as libc::c_uint)
        |                             ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x10000_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:395:65
        |
    395 |                 || value >= 0x10000 as libc::c_uint && value <= 0x10ffff as libc::c_uint)
        |                                                                 ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x10ffff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:409:25
        |
    409 |             if value <= 0x7f as libc::c_uint {
        |                         ^^^^^^^^^^^^^^^^^^^^ help: try: `0x7f_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:414:32
        |
    414 |             } else if value <= 0x7ff as libc::c_uint {
        |                                ^^^^^^^^^^^^^^^^^^^^^ help: try: `0x7ff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:418:28
        |
    418 |                 *fresh19 = (0xc0 as libc::c_uint).wrapping_add(value >> 6) as yaml_char_t;
        |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xc0_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:422:28
        |
    422 |                 *fresh21 = (0x80 as libc::c_uint).wrapping_add(value & 0x3f as libc::c_uint)
        |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:422:72
        |
    422 |                 *fresh21 = (0x80 as libc::c_uint).wrapping_add(value & 0x3f as libc::c_uint)
        |                                                                        ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:424:32
        |
    424 |             } else if value <= 0xffff as libc::c_uint {
        |                                ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xffff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:428:28
        |
    428 |                 *fresh23 = (0xe0 as libc::c_uint).wrapping_add(value >> 12) as yaml_char_t;
        |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xe0_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:432:28
        |
    432 |                 *fresh25 = (0x80 as libc::c_uint).wrapping_add(value >> 6 & 0x3f as libc::c_uint)
        |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:432:77
        |
    432 |                 *fresh25 = (0x80 as libc::c_uint).wrapping_add(value >> 6 & 0x3f as libc::c_uint)
        |                                                                             ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:437:28
        |
    437 |                 *fresh27 = (0x80 as libc::c_uint).wrapping_add(value & 0x3f as libc::c_uint)
        |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:437:72
        |
    437 |                 *fresh27 = (0x80 as libc::c_uint).wrapping_add(value & 0x3f as libc::c_uint)
        |                                                                        ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:443:28
        |
    443 |                 *fresh29 = (0xf0 as libc::c_uint).wrapping_add(value >> 18) as yaml_char_t;
        |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xf0_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:447:28
        |
    447 |                 *fresh31 = (0x80 as libc::c_uint).wrapping_add(value >> 12 & 0x3f as libc::c_uint)
        |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:447:78
        |
    447 |                 *fresh31 = (0x80 as libc::c_uint).wrapping_add(value >> 12 & 0x3f as libc::c_uint)
        |                                                                              ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:452:28
        |
    452 |                 *fresh33 = (0x80 as libc::c_uint).wrapping_add(value >> 6 & 0x3f as libc::c_uint)
        |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:452:77
        |
    452 |                 *fresh33 = (0x80 as libc::c_uint).wrapping_add(value >> 6 & 0x3f as libc::c_uint)
        |                                                                             ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:457:28
        |
    457 |                 *fresh35 = (0x80 as libc::c_uint).wrapping_add(value & 0x3f as libc::c_uint)
        |                            ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/reader.rs:457:72
        |
    457 |                 *fresh35 = (0x80 as libc::c_uint).wrapping_add(value & 0x3f as libc::c_uint)
        |                                                                        ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2611:57
         |
    2611 | ...                   if value >= 0xd800 as libc::c_uint
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xd800_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2612:61
         |
    2612 | ...                   && value <= 0xdfff as libc::c_uint
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xdfff_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2613:60
         |
    2613 | ...                   || value > 0x10ffff as libc::c_uint
         |                                  ^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x10ffff_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2627:61
         |
    2627 | ...                   if value <= 0x7f as libc::c_uint {
         |                                   ^^^^^^^^^^^^^^^^^^^^ help: try: `0x7f_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2632:68
         |
    2632 | ...                   } else if value <= 0x7ff as libc::c_uint {
         |                                          ^^^^^^^^^^^^^^^^^^^^^ help: try: `0x7ff_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2636:65
         |
    2636 | ...                   *fresh574 = (0xc0 as libc::c_uint)
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xc0_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2642:65
         |
    2642 | ...                   *fresh575 = (0x80 as libc::c_uint)
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2643:79
         |
    2643 | ...                   .wrapping_add(value & 0x3f as libc::c_uint)
         |                                             ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2645:68
         |
    2645 | ...                   } else if value <= 0xffff as libc::c_uint {
         |                                          ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xffff_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2649:65
         |
    2649 | ...                   *fresh576 = (0xe0 as libc::c_uint)
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xe0_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2655:65
         |
    2655 | ...                   *fresh577 = (0x80 as libc::c_uint).wrapping_add(
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2656:70
         |
    2656 | ...                   value >> 6 & 0x3f as libc::c_uint,
         |                                    ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2662:65
         |
    2662 | ...                   *fresh578 = (0x80 as libc::c_uint)
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2663:79
         |
    2663 | ...                   .wrapping_add(value & 0x3f as libc::c_uint)
         |                                             ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2669:65
         |
    2669 | ...                   *fresh579 = (0xf0 as libc::c_uint)
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xf0_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2675:65
         |
    2675 | ...                   *fresh580 = (0x80 as libc::c_uint).wrapping_add(
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2676:71
         |
    2676 | ...                   value >> 12 & 0x3f as libc::c_uint,
         |                                     ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2682:65
         |
    2682 | ...                   *fresh581 = (0x80 as libc::c_uint).wrapping_add(
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2683:70
         |
    2683 | ...                   value >> 6 & 0x3f as libc::c_uint,
         |                                    ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2689:65
         |
    2689 | ...                   *fresh582 = (0x80 as libc::c_uint)
         |                                   ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x80_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
        --> src/scanner.rs:2690:79
         |
    2690 | ...                   .wrapping_add(value & 0x3f as libc::c_uint)
         |                                             ^^^^^^^^^^^^^^^^^^^^ help: try: `0x3f_u32`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/writer.rs:101:20
        |
    101 |         if value < 0x10000 as libc::c_uint {
        |                    ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x10000_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/writer.rs:105:26
        |
    105 |                 (value & 0xff as libc::c_uint) as libc::c_uchar;
        |                          ^^^^^^^^^^^^^^^^^^^^ help: try: `0xff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/writer.rs:109:40
        |
    109 |             value = value.wrapping_sub(0x10000 as libc::c_uint);
        |                                        ^^^^^^^^^^^^^^^^^^^^^^^ help: try: `0x10000_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/writer.rs:111:17
        |
    111 |                 (0xd8 as libc::c_uint).wrapping_add(value >> 18) as libc::c_uchar;
        |                 ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xd8_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/writer.rs:113:32
        |
    113 |                 (value >> 10 & 0xff as libc::c_uint) as libc::c_uchar;
        |                                ^^^^^^^^^^^^^^^^^^^^ help: try: `0xff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/writer.rs:117:57
        |
    117 |                 .wrapping_offset((high + 2) as isize) = (0xdc as libc::c_uint)
        |                                                         ^^^^^^^^^^^^^^^^^^^^^^ help: try: `0xdc_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/writer.rs:118:44
        |
    118 |                 .wrapping_add(value >> 8 & 0xff as libc::c_uint)
        |                                            ^^^^^^^^^^^^^^^^^^^^ help: try: `0xff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting integer literal to `u32` is unnecessary
       --> src/writer.rs:124:26
        |
    124 |                 (value & 0xff as libc::c_uint) as libc::c_uchar;
        |                          ^^^^^^^^^^^^^^^^^^^^ help: try: `0xff_u32`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
2022-07-23 13:50:33 -07:00
David Tolnay
39bf233ca6
Remove unneeded integer suffixes
sed -i 's/_i32//' src/*.rs
2022-07-23 13:47:25 -07:00
David Tolnay
08913865a8
Move .ok out of WRITE macros 2022-07-23 13:35:41 -07:00
David Tolnay
807f8e23ca
Clean up control flow in emitter helpers 2022-07-23 13:34:06 -07:00
David Tolnay
99363eb8b7
Replace !result.ok with result.fail and vice versa 2022-07-23 13:27:45 -07:00
David Tolnay
d28f0332aa
Delete unneeded parens 2022-07-23 13:20:43 -07:00
David Tolnay
afd7549537
Remove ParialEq<Zero> from Success
Generated with the assistance of:

    sed -i 's/ != Zero\b/.ok/' src/*.rs
    sed -i 's/ == Zero\b/.fail/' src/*.rs
2022-07-23 12:59:10 -07:00
David Tolnay
59e30ab74e
Merge pull request #5 from dtolnay/fail
Expose .fail as the opposite of .ok
2022-07-23 12:58:59 -07:00
David Tolnay
fb6de5f433
Expose .fail as the opposite of .ok 2022-07-23 12:51:54 -07:00
David Tolnay
c47432e38b
Remove ParialEq<i32> from Success
Generated with the assistance of:

    sed -i 's/) == 0\b/) == Zero/' src/*.rs
    sed -i 's/) != 0\b/) != Zero/' src/*.rs
2022-07-23 12:47:59 -07:00
David Tolnay
a69723b2d8
Clean up error checking in fuzzer and bins 2022-07-23 12:47:09 -07:00
David Tolnay
093886f2d2
Switch emitter helpers to Success 2022-07-23 12:35:50 -07:00
David Tolnay
76b86e46a4
Switch to Success in macro expansions 2022-07-23 12:27:35 -07:00
David Tolnay
9c2427cee4
Convert emitter check functions to return bool 2022-07-23 12:23:58 -07:00
David Tolnay
11ccd20d29
Update signature of READ helpers 2022-07-23 12:23:58 -07:00
David Tolnay
bb28c2ac3f
Merge pull request #4 from dtolnay/success
Remove return value from error setter functions
2022-07-23 12:23:48 -07:00
David Tolnay
ad48c6c7a7
Remove return value from error setter functions 2022-07-23 12:17:35 -07:00
David Tolnay
b8b6bbe1b4
Merge pull request #3 from dtolnay/success
Add must_use to Success
2022-07-23 12:17:27 -07:00
David Tolnay
252b895103
Add must_use to Success 2022-07-23 12:10:16 -07:00
David Tolnay
f0f958d9fb
Merge pull request #2 from dtolnay/success
Replace 1/0 exit codes with Success type
2022-07-23 12:06:33 -07:00
David Tolnay
f90a3aee19
Replace 1/0 exit codes with Success type 2022-07-23 12:00:09 -07:00
David Tolnay
ba4bcb611e
Release 0.1.3 2022-07-23 01:21:48 -07:00
David Tolnay
a59ca716e8
Change yaml_mark_t.index to count bytes not codepoints 2022-07-23 01:11:07 -07:00
David Tolnay
c7752de455
Reduce addr_of_mut usage in scanner macros 2022-07-23 01:10:58 -07:00
David Tolnay
3d30605f5b
Delegate WRITE and WRITE_BREAK macros to function 2022-07-23 01:10:57 -07:00
David Tolnay
e73ae32cec
Replace PUT_BREAK macro with function 2022-07-23 01:10:56 -07:00
David Tolnay
473f07b9f1
Replace PUT macro with function 2022-07-23 01:10:56 -07:00
David Tolnay
65b156d981
Remove yaml_char_t conversion from PUT arg 2022-07-23 01:10:55 -07:00
David Tolnay
4d9cd1d6b2
Replace FLUSH macro with function 2022-07-23 01:10:54 -07:00
David Tolnay
69a3671ee4
Replace SKIP_TOKEN macro with function 2022-07-23 01:10:54 -07:00
David Tolnay
96b8563adb
Ignore while_immutable_condition clippy false positive
https://github.com/rust-lang/rust-clippy/issues/3548

    error: variables in the condition are not mutated in the loop body
        --> src/scanner.rs:1031:15
         |
    1031 |           while CHECK!((*parser).buffer, b' ')
         |  _______________^
    1032 | |             || ((*parser).flow_level != 0 || (*parser).simple_key_allowed == 0)
    1033 | |                 && CHECK!((*parser).buffer, b'\t')
         | |__________________________________________________^
         |
         = note: `-D clippy::while-immutable-condition` implied by `-D clippy::all`
         = note: this may lead to an infinite or to a never running loop
         = note: this loop contains `return`s or `break`s
         = help: rewrite it as `if cond { loop { } }`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_immutable_condition

    error: variables in the condition are not mutated in the loop body
        --> src/macros.rs:138:9
         |
    138  |         *$string.pointer >= b'0' && *$string.pointer <= b'9'
         |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         |
        ::: src/scanner.rs:1319:11
         |
    1319 |     while IS_DIGIT!((*parser).buffer) {
         |           --------------------------- in this macro invocation
         |
         = note: this may lead to an infinite or to a never running loop
         = note: this loop contains `return`s or `break`s
         = help: rewrite it as `if cond { loop { } }`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#while_immutable_condition
         = note: this error originates in the macro `IS_DIGIT` (in Nightly builds, run with -Z macro-backtrace for more info)
2022-07-23 01:10:53 -07:00
David Tolnay
5b459eb8fe
Replace PEEK_TOKEN macro with function 2022-07-23 01:10:52 -07:00