Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypass negative literal workaround on 1.56+ #1088

Merged
merged 5 commits into from Oct 26, 2021
Merged

Bypass negative literal workaround on 1.56+ #1088

merged 5 commits into from Oct 26, 2021

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Oct 26, 2021

    error: this function's return value is unnecessarily wrapped by `Option`
        --> src/lit.rs:1542:5
         |
    1542 | /     pub fn to_literal(repr: &str, digits: &str, suffix: &str) -> Option<Literal> {
    1543 | |         #[cfg(syn_no_negative_literal_parse)]
    1544 | |         {
    1545 | |             if repr.starts_with('-') {
    ...    |
    1571 | |         Some(repr.parse::<Literal>().unwrap())
    1572 | |     }
         | |_____^
         |
         = note: `-D clippy::unnecessary-wraps` implied by `-D clippy::pedantic`
         = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
    help: remove `Option` from the return type...
         |
    1542 |     pub fn to_literal(repr: &str, digits: &str, suffix: &str) -> proc_macro2::Literal {
         |                                                                  ~~~~~~~~~~~~~~~~~~~~
    help: ...and then change returning expressions
         |
    1571 |         repr.parse::<Literal>().unwrap()
         |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant