Skip to content

match_same_arms: false negative #4244

@matthiaskrgr

Description

@matthiaskrgr
#![deny(clippy::match_same_arms)] #[derive(PartialEq, PartialOrd, Eq, Ord)] pub enum CommandInfo { BuiltIn { name: String, about: Option<String> }, External { name: String, path: std::path::PathBuf }, } impl CommandInfo { pub fn name(&self) -> String { match self { CommandInfo::BuiltIn { name, .. } => name.to_string(), CommandInfo::External { name, .. } => name.to_string(), } } } fn main() {}

This used to trigger back on June 3rd but no longer does in July 1st (clippy 0.0.212 (e3cb40e 2019-06-25))

Looks like a false negative to me?


EDIT(@flip1995): Playground

EDIT(matthiaskrgr): code is from cargo 0.35.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions