imp: Hash for Arg

This commit is contained in:
Alena Yuryeva 2018-06-30 21:03:49 +03:00
parent cc082a0347
commit 2133bd148b

View file

@ -13,6 +13,7 @@ use std::os::unix::ffi::OsStrExt;
use std::env;
use std::cmp::{Ord, Ordering};
use std::str;
use std::hash::{Hash, Hasher};
// Third Party
#[cfg(feature = "yaml")]
@ -4195,6 +4196,12 @@ impl<'n, 'e> Ord for Arg<'n, 'e> {
impl<'n, 'e> Eq for Arg<'n, 'e> {}
impl<'n, 'e> Hash for Arg<'n, 'e> {
fn hash<H: Hasher>(&self, state: &mut H) {
self.name.hash(state);
}
}
impl<'n, 'e> fmt::Debug for Arg<'n, 'e> {
fn fmt(&self, f: &mut Formatter) -> Result<(), fmt::Error> {
write!(