Skip to content

[nightly] unnecessary parentheses warning #668

Closed
@SWW13

Description

@SWW13

Recent nightly versions give warnings when using named!() and do_parse!():

named!(pub parse_string <String>, do_parse!(
    value: map_res!(take_until!("\x00"), |value: &[u8]| String::from_utf8(value.to_vec())) >>
    tag!(b"\x00") >>
    (value)
));
warning: unnecessary parentheses around function argument
   |
13 | / named!(pub parse_string <String>, do_parse!(
14 | |     value: map_res!(take_until!("\x00"), |value: &[u8]| String::from_utf8(value.to_vec())) >>
15 | |     tag!(b"\x00") >>
16 | |     (value)
17 | | ));
   | |___^ help: remove these parentheses
   |
   = note: #[warn(unused_parens)] on by default
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

rustc --version --verbose:

rustc 1.25.0-nightly (4e3901d35 2018-01-23)
binary: rustc
commit-hash: 4e3901d35f6a8652f67111e7272263c9e62ab3e1
commit-date: 2018-01-23
host: x86_64-unknown-linux-gnu
release: 1.25.0-nightly
LLVM version: 4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions