]> git.proxmox.com Git - rustc.git/blobdiff - vendor/clap/src/mkeymap.rs
New upstream version 1.63.0+dfsg1
[rustc.git] / vendor / clap / src / mkeymap.rs
index 54d29e814c751e5788ca07abeb91ece2a62de2a3..97ecdda776660083bbec7730330c8863699662d5 100644 (file)
@@ -1,6 +1,10 @@
-use crate::{build::Arg, util::Id, INTERNAL_ERROR_MSG};
+use std::iter::Iterator;
+use std::ops::Index;
+use std::{ffi::OsStr, ffi::OsString};
 
-use std::{ffi::OsStr, ffi::OsString, iter::Iterator, ops::Index};
+use crate::util::Id;
+use crate::Arg;
+use crate::INTERNAL_ERROR_MSG;
 
 #[derive(PartialEq, Eq, Debug, Clone)]
 pub(crate) struct Key {
@@ -49,6 +53,15 @@ impl PartialEq<&str> for KeyType {
     }
 }
 
+impl PartialEq<str> for KeyType {
+    fn eq(&self, rhs: &str) -> bool {
+        match self {
+            KeyType::Long(l) => l == rhs,
+            _ => false,
+        }
+    }
+}
+
 impl PartialEq<OsStr> for KeyType {
     fn eq(&self, rhs: &OsStr) -> bool {
         match self {