Skip to content

New lint: "unnecessary return foo() because foo returns ()" #8055

Closed
@alco

Description

@alco

As suggested by @huonw in IRC.

From sha1 implementation here:

fn mk_result(st: &mut Sha1, rs: &mut [u8]) { ... }
fn result(&mut self, out: &mut [u8]) { return mk_result(self, out); }

This last line should emit the warning.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions