Commit graph

319 commits

Author SHA1 Message Date
David Tolnay
05927a935d
Fix renamed let_underscore_drop lint
warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
      --> src/lib.rs:23:5
       |
    23 |     clippy::let_underscore_drop,
       |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
       |
       = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
     --> src/bin/run-emitter-test-suite.rs:8:5
      |
    8 |     clippy::let_underscore_drop,
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default

    warning: lint `clippy::let_underscore_drop` has been renamed to `let_underscore_drop`
     --> src/bin/run-parser-test-suite.rs:8:5
      |
    8 |     clippy::let_underscore_drop,
      |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: use the new name: `let_underscore_drop`
      |
      = note: `#[warn(renamed_and_removed_lints)]` on by default
2022-11-22 19:18:21 -08:00
David Tolnay
09ae09301c
Resolve needless_borrow pedantic clippy lint in test
error: the borrowed expression implements the required traits
      --> tests/data/lib.rs:36:31
       |
    36 |     for entry in fs::read_dir(&yaml_test_suite).unwrap() {
       |                               ^^^^^^^^^^^^^^^^ help: change this to: `yaml_test_suite`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
       = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
2022-10-24 21:42:13 -07:00
David Tolnay
447a4caa09
Resolve needless_borrow pedantic clippy lint in test
error: the borrowed expression implements the required traits
      --> tests/data/build.rs:23:43
       |
    23 |     let response = reqwest::blocking::get(&url)?.error_for_status()?;
       |                                           ^^^^ help: change this to: `url`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow
       = note: `-D clippy::needless-borrow` implied by `-D clippy::all`
2022-10-24 21:33:15 -07:00
David Tolnay
6a235b324e
Ignore uninlined_format_args pedantic clippy lint
error: variables can be used directly in the `format!` string
      --> tests/data/build.rs:24:18
       |
    24 |     let prefix = format!("yaml-test-suite-{}", TAG);
       |                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#uninlined_format_args
       = note: `-D clippy::uninlined-format-args` implied by `-D clippy::pedantic`
    help: change this to
       |
    24 -     let prefix = format!("yaml-test-suite-{}", TAG);
    24 +     let prefix = format!("yaml-test-suite-{TAG}");
       |
2022-10-07 22:25:36 -07:00
David Tolnay
37ccd89b21
Ignore unnecessary_cast clippy lint
error: casting to the same type is unnecessary (`u64` -> `u64`)
       --> src/api.rs:377:17
        |
    377 |     *fresh153 = (*fresh153 as libc::c_ulong).wrapping_add(size) as size_t as size_t;
        |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*fresh153 as libc::c_ulong).wrapping_add(size) as size_t`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
        = note: `-D clippy::unnecessary-cast` implied by `-D clippy::all`

    error: casting to the same type is unnecessary (`u64` -> `u64`)
       --> src/api.rs:377:17
        |
    377 |     *fresh153 = (*fresh153 as libc::c_ulong).wrapping_add(size) as size_t as size_t;
        |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*fresh153 as libc::c_ulong).wrapping_add(size)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
       --> src/api.rs:377:17
        |
    377 |     *fresh153 = (*fresh153 as libc::c_ulong).wrapping_add(size) as size_t as size_t;
        |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `*fresh153`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1062:22
         |
    1062 |               length = (length as libc::c_ulong).wrapping_add((*emitter).anchor_data.anchor_length)
         |  ______________________^
    1063 | |                 as size_t as size_t;
         | |___________________________________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    help: try
         |
    1062 ~             length = (length as libc::c_ulong).wrapping_add((*emitter).anchor_data.anchor_length)
    1063 ~                 as size_t;
         |

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1062:22
         |
    1062 |               length = (length as libc::c_ulong).wrapping_add((*emitter).anchor_data.anchor_length)
         |  ______________________^
    1063 | |                 as size_t as size_t;
         | |_________________________^ help: try: `(length as libc::c_ulong).wrapping_add((*emitter).anchor_data.anchor_length)`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1062:22
         |
    1062 |             length = (length as libc::c_ulong).wrapping_add((*emitter).anchor_data.anchor_length)
         |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `length`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1069:22
         |
    1069 |               length = (length as libc::c_ulong).wrapping_add(
         |  ______________________^
    1070 | |                 (*emitter)
    1071 | |                     .anchor_data
    1072 | |                     .anchor_length
    ...    |
    1075 | |                     .wrapping_add((*emitter).scalar_data.length),
    1076 | |             ) as size_t as size_t;
         | |_________________________________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    help: try
         |
    1069 ~             length = (length as libc::c_ulong).wrapping_add(
    1070 +                 (*emitter)
    1071 +                     .anchor_data
    1072 +                     .anchor_length
    1073 +                     .wrapping_add((*emitter).tag_data.handle_length)
    1074 +                     .wrapping_add((*emitter).tag_data.suffix_length)
    1075 +                     .wrapping_add((*emitter).scalar_data.length),
    1076 ~             ) as size_t;
         |

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1069:22
         |
    1069 |               length = (length as libc::c_ulong).wrapping_add(
         |  ______________________^
    1070 | |                 (*emitter)
    1071 | |                     .anchor_data
    1072 | |                     .anchor_length
    ...    |
    1075 | |                     .wrapping_add((*emitter).scalar_data.length),
    1076 | |             ) as size_t as size_t;
         | |_______________________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    help: try
         |
    1069 ~             length = (length as libc::c_ulong).wrapping_add(
    1070 +                 (*emitter)
    1071 +                     .anchor_data
    1072 +                     .anchor_length
    1073 +                     .wrapping_add((*emitter).tag_data.handle_length)
    1074 +                     .wrapping_add((*emitter).tag_data.suffix_length)
    1075 +                     .wrapping_add((*emitter).scalar_data.length),
    1076 ~             ) as size_t;
         |

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1069:22
         |
    1069 |             length = (length as libc::c_ulong).wrapping_add(
         |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `length`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1082:22
         |
    1082 |               length = (length as libc::c_ulong).wrapping_add(
         |  ______________________^
    1083 | |                 (*emitter)
    1084 | |                     .anchor_data
    1085 | |                     .anchor_length
    1086 | |                     .wrapping_add((*emitter).tag_data.handle_length)
    1087 | |                     .wrapping_add((*emitter).tag_data.suffix_length),
    1088 | |             ) as size_t as size_t;
         | |_________________________________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    help: try
         |
    1082 ~             length = (length as libc::c_ulong).wrapping_add(
    1083 +                 (*emitter)
    1084 +                     .anchor_data
    1085 +                     .anchor_length
    1086 +                     .wrapping_add((*emitter).tag_data.handle_length)
    1087 +                     .wrapping_add((*emitter).tag_data.suffix_length),
    1088 ~             ) as size_t;
         |

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1082:22
         |
    1082 |               length = (length as libc::c_ulong).wrapping_add(
         |  ______________________^
    1083 | |                 (*emitter)
    1084 | |                     .anchor_data
    1085 | |                     .anchor_length
    1086 | |                     .wrapping_add((*emitter).tag_data.handle_length)
    1087 | |                     .wrapping_add((*emitter).tag_data.suffix_length),
    1088 | |             ) as size_t as size_t;
         | |_______________________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    help: try
         |
    1082 ~             length = (length as libc::c_ulong).wrapping_add(
    1083 +                 (*emitter)
    1084 +                     .anchor_data
    1085 +                     .anchor_length
    1086 +                     .wrapping_add((*emitter).tag_data.handle_length)
    1087 +                     .wrapping_add((*emitter).tag_data.suffix_length),
    1088 ~             ) as size_t;
         |

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1082:22
         |
    1082 |             length = (length as libc::c_ulong).wrapping_add(
         |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `length`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1094:22
         |
    1094 |               length = (length as libc::c_ulong).wrapping_add(
         |  ______________________^
    1095 | |                 (*emitter)
    1096 | |                     .anchor_data
    1097 | |                     .anchor_length
    1098 | |                     .wrapping_add((*emitter).tag_data.handle_length)
    1099 | |                     .wrapping_add((*emitter).tag_data.suffix_length),
    1100 | |             ) as size_t as size_t;
         | |_________________________________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    help: try
         |
    1094 ~             length = (length as libc::c_ulong).wrapping_add(
    1095 +                 (*emitter)
    1096 +                     .anchor_data
    1097 +                     .anchor_length
    1098 +                     .wrapping_add((*emitter).tag_data.handle_length)
    1099 +                     .wrapping_add((*emitter).tag_data.suffix_length),
    1100 ~             ) as size_t;
         |

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1094:22
         |
    1094 |               length = (length as libc::c_ulong).wrapping_add(
         |  ______________________^
    1095 | |                 (*emitter)
    1096 | |                     .anchor_data
    1097 | |                     .anchor_length
    1098 | |                     .wrapping_add((*emitter).tag_data.handle_length)
    1099 | |                     .wrapping_add((*emitter).tag_data.suffix_length),
    1100 | |             ) as size_t as size_t;
         | |_______________________^
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
    help: try
         |
    1094 ~             length = (length as libc::c_ulong).wrapping_add(
    1095 +                 (*emitter)
    1096 +                     .anchor_data
    1097 +                     .anchor_length
    1098 +                     .wrapping_add((*emitter).tag_data.handle_length)
    1099 +                     .wrapping_add((*emitter).tag_data.suffix_length),
    1100 ~             ) as size_t;
         |

    error: casting to the same type is unnecessary (`u64` -> `u64`)
        --> src/emitter.rs:1094:22
         |
    1094 |             length = (length as libc::c_ulong).wrapping_add(
         |                      ^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `length`
         |
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
      --> src/reader.rs:55:19
       |
    55 |         *fresh2 = (*fresh2 as libc::c_ulong).wrapping_add(2_u64) as size_t as size_t;
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*fresh2 as libc::c_ulong).wrapping_add(2_u64) as size_t`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
      --> src/reader.rs:55:19
       |
    55 |         *fresh2 = (*fresh2 as libc::c_ulong).wrapping_add(2_u64) as size_t as size_t;
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*fresh2 as libc::c_ulong).wrapping_add(2_u64)`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
      --> src/reader.rs:55:19
       |
    55 |         *fresh2 = (*fresh2 as libc::c_ulong).wrapping_add(2_u64) as size_t as size_t;
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `*fresh2`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
      --> src/reader.rs:71:19
       |
    71 |         *fresh4 = (*fresh4 as libc::c_ulong).wrapping_add(2_u64) as size_t as size_t;
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*fresh4 as libc::c_ulong).wrapping_add(2_u64) as size_t`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
      --> src/reader.rs:71:19
       |
    71 |         *fresh4 = (*fresh4 as libc::c_ulong).wrapping_add(2_u64) as size_t as size_t;
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*fresh4 as libc::c_ulong).wrapping_add(2_u64)`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
      --> src/reader.rs:71:19
       |
    71 |         *fresh4 = (*fresh4 as libc::c_ulong).wrapping_add(2_u64) as size_t as size_t;
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `*fresh4`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
      --> src/reader.rs:87:19
       |
    87 |         *fresh6 = (*fresh6 as libc::c_ulong).wrapping_add(3_u64) as size_t as size_t;
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*fresh6 as libc::c_ulong).wrapping_add(3_u64) as size_t`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
      --> src/reader.rs:87:19
       |
    87 |         *fresh6 = (*fresh6 as libc::c_ulong).wrapping_add(3_u64) as size_t as size_t;
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*fresh6 as libc::c_ulong).wrapping_add(3_u64)`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
      --> src/reader.rs:87:19
       |
    87 |         *fresh6 = (*fresh6 as libc::c_ulong).wrapping_add(3_u64) as size_t as size_t;
       |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `*fresh6`
       |
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
       --> src/reader.rs:400:24
        |
    400 |               *fresh15 = (*fresh15 as libc::c_ulong).wrapping_add(width as libc::c_ulong) as size_t
        |  ________________________^
    401 | |                 as size_t;
        | |_________________________^ help: try: `(*fresh15 as libc::c_ulong).wrapping_add(width as libc::c_ulong) as size_t`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
       --> src/reader.rs:400:24
        |
    400 |             *fresh15 = (*fresh15 as libc::c_ulong).wrapping_add(width as libc::c_ulong) as size_t
        |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `(*fresh15 as libc::c_ulong).wrapping_add(width as libc::c_ulong)`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast

    error: casting to the same type is unnecessary (`u64` -> `u64`)
       --> src/reader.rs:400:24
        |
    400 |             *fresh15 = (*fresh15 as libc::c_ulong).wrapping_add(width as libc::c_ulong) as size_t
        |                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `*fresh15`
        |
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_cast
2022-10-07 22:24:41 -07:00
David Tolnay
e41536d8bd
Release 0.2.4 2022-09-14 21:51:53 -07:00
David Tolnay
e9acfac109
Merge pull request #18 from dtolnay/allocerror
Check allocations for OOM
2022-09-14 21:48:51 -07:00
David Tolnay
7b4443449a
Check allocations for OOM 2022-09-14 21:41:01 -07:00
David Tolnay
435406fd7f
Release 0.2.3 2022-09-14 12:38:25 -07:00
David Tolnay
67d67319d9
Add a sponsors link 2022-09-14 12:37:15 -07:00
David Tolnay
ad5874f594
Remove default package.readme metadata from Cargo.toml
Since cargo 1.46.0, README.md is recognized by default.
2022-09-14 09:16:02 -07:00
David Tolnay
f8756063ff
Ignore bool_to_int_with_if clippy lint
error: boolean to int conversion using if
       --> src/reader.rs:301:28
        |
    301 |                       high = if (*parser).encoding == YAML_UTF16LE_ENCODING {
        |  ____________________________^
    302 | |                         1
    303 | |                     } else {
    304 | |                         0
    305 | |                     };
        | |_____________________^ help: replace with from: `i32::from((*parser).encoding == YAML_UTF16LE_ENCODING)`
        |
        = note: `-D clippy::bool-to-int-with-if` implied by `-D clippy::all`
        = note: `((*parser).encoding == YAML_UTF16LE_ENCODING) as i32` or `((*parser).encoding == YAML_UTF16LE_ENCODING).into()` can also be valid options
        = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if

    error: boolean to int conversion using if
      --> src/writer.rs:58:29
       |
    58 |       let high: libc::c_int = if (*emitter).encoding == YAML_UTF16LE_ENCODING {
       |  _____________________________^
    59 | |         1
    60 | |     } else {
    61 | |         0
    62 | |     };
       | |_____^ help: replace with from: `i32::from((*emitter).encoding == YAML_UTF16LE_ENCODING)`
       |
       = note: `((*emitter).encoding == YAML_UTF16LE_ENCODING) as i32` or `((*emitter).encoding == YAML_UTF16LE_ENCODING).into()` can also be valid options
       = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#bool_to_int_with_if
2022-09-10 20:16:54 -07:00
David Tolnay
97bc12eaa1
GitHub Workflows security hardening 2022-09-02 15:09:32 -07:00
David Tolnay
fcf3f66309
Release 0.2.2 2022-08-02 16:00:51 -07:00
David Tolnay
ab4842d481
Merge pull request #17 from dtolnay/debug
Derive Debug for all enums
2022-08-02 15:59:46 -07:00
David Tolnay
70f67044e4
Derive Debug for all enums 2022-08-02 15:53:32 -07:00
David Tolnay
069b7149dd
Add categories to crates.io metadata 2022-08-01 00:06:49 -07:00
David Tolnay
4943da1452
Add authors to Cargo.toml 2022-07-31 19:25:47 -07:00
David Tolnay
bf012f373c
Sort package entries in Cargo.toml 2022-07-31 19:19:06 -07:00
David Tolnay
5548f3544e
Simplify some current_block matches 2022-07-30 02:49:26 -07:00
David Tolnay
91400c631f
Simplify cases with same current_block on both branches 2022-07-30 02:38:47 -07:00
David Tolnay
9286fad451
Eliminate return value of some scanner functions 2022-07-30 02:29:21 -07:00
David Tolnay
c88e4039e1
Eliminate return value of emitter increase indent 2022-07-30 02:24:38 -07:00
David Tolnay
cc34693df5
Control flow cleanup 2022-07-30 02:23:08 -07:00
David Tolnay
c5981734ce
Remove $context arg from macros where unused 2022-07-30 02:13:03 -07:00
David Tolnay
44b9e9795a
Eliminate return value of stack push 2022-07-30 02:06:23 -07:00
David Tolnay
560f7b2032
Eliminate return value of queue extend 2022-07-30 01:50:39 -07:00
David Tolnay
5cc0719831
Eliminate return value of string join 2022-07-30 01:41:45 -07:00
David Tolnay
83c0c40ea6
Eliminate return value of scanner read helpers 2022-07-30 01:36:29 -07:00
David Tolnay
4ae8d3df25
Eliminate return value of string extend 2022-07-30 01:33:15 -07:00
David Tolnay
f88b6641c2
Merge pull request #15 from dtolnay/oom
More malloc cleanup
2022-07-30 01:33:06 -07:00
David Tolnay
71d266d6de
Resolve needless_late_init clippy lints 2022-07-30 01:25:44 -07:00
David Tolnay
a06fe68a3e
Clean up dead code in parser init and emitter init 2022-07-30 01:21:18 -07:00
David Tolnay
da96d42456
Eliminate return value of queue init 2022-07-30 01:20:14 -07:00
David Tolnay
5c028a3ded
Eliminate return value of string init 2022-07-30 01:20:03 -07:00
David Tolnay
e0a86e6089
Eliminate return value of stack init 2022-07-30 01:16:44 -07:00
David Tolnay
ed7d2e6037
Remove unused parser arg of process_empty_scalar 2022-07-30 01:13:21 -07:00
David Tolnay
82fd332271
Eliminate return value of buffer init 2022-07-30 01:13:21 -07:00
David Tolnay
76ea0104e0
Merge pull request #14 from dtolnay/oom
Remove malloc null checks
2022-07-30 01:13:14 -07:00
David Tolnay
85bc4324fc
Remove malloc null checks 2022-07-30 01:06:08 -07:00
David Tolnay
5d421b89e9
Release 0.2.1 2022-07-27 18:33:49 -07:00
David Tolnay
43ecb070ec
Merge pull request #13 from dtolnay/stackoverflow
Fix stack overflow in yaml_emitter_anchor_node
2022-07-27 18:25:41 -07:00
David Tolnay
d18c7dc407
Fix stack overflow in yaml_emitter_anchor_node 2022-07-27 18:18:47 -07:00
David Tolnay
1884364957
Merge pull request #12 from dtolnay/bufferoverflow
Fix heap buffer overflow in yaml_emitter_emit_flow_mapping_key
2022-07-27 18:18:41 -07:00
David Tolnay
90b50bb321
Remove unneeded _usize integer suffix 2022-07-27 18:10:48 -07:00
David Tolnay
b1cc5567b2
Fix heap buffer overflow in yaml_emitter_emit_flow_mapping_key 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