chore: ordermap to indexmap

This commit is contained in:
Kevin K 2018-06-12 10:22:18 -04:00
parent b7e38fb62a
commit b033bb5abc
No known key found for this signature in database
GPG key ID: 17218E4B3692F01A
4 changed files with 9 additions and 9 deletions

View file

@ -51,7 +51,7 @@ maintenance = {status = "actively-developed"}
bitflags = "1.0"
unicode-width = "0.1.4"
textwrap = "0.10.0"
ordermap = "0.3.5"
indexmap = "1.0.1"
strsim = { version = "0.7.0", optional = true }
yaml-rust = { version = "0.3.5", optional = true }
clippy = { version = "~0.0.166", optional = true }

View file

@ -4,7 +4,7 @@ use std::collections::HashMap;
use std::mem;
// Third Party
use ordermap;
use indexmap;
// Internal
use args::{Arg, ArgMatches, MatchedArg, SubCommand};
@ -90,9 +90,9 @@ impl<'a> ArgMatcher<'a> {
pub fn usage(&mut self, usage: String) { self.0.usage = Some(usage); }
pub fn arg_names(&'a self) -> ordermap::Keys<&'a str, MatchedArg> { self.0.args.keys() }
pub fn arg_names(&'a self) -> indexmap::map::Keys<&'a str, MatchedArg> { self.0.args.keys() }
pub fn entry(&mut self, arg: &'a str) -> ordermap::Entry<&'a str, MatchedArg> {
pub fn entry(&mut self, arg: &'a str) -> indexmap::map::Entry<&'a str, MatchedArg> {
self.0.args.entry(arg)
}
@ -100,7 +100,7 @@ impl<'a> ArgMatcher<'a> {
pub fn subcommand_name(&self) -> Option<&str> { self.0.subcommand_name() }
pub fn iter(&self) -> ordermap::Iter<&str, MatchedArg> { self.0.args.iter() }
pub fn iter(&self) -> indexmap::map::Iter<&str, MatchedArg> { self.0.args.iter() }
pub fn inc_occurrence_of(&mut self, arg: &'a str) {
debugln!("ArgMatcher::inc_occurrence_of: arg={}", arg);

View file

@ -5,7 +5,7 @@ use std::iter::Map;
use std::slice::Iter;
// Third Party
use ordermap::OrderMap;
use indexmap::IndexMap;
// Internal
use INVALID_UTF8;
@ -62,7 +62,7 @@ use args::SubCommand;
#[derive(Debug, Clone)]
pub struct ArgMatches<'a> {
#[doc(hidden)]
pub args: OrderMap<&'a str, MatchedArg>,
pub args: IndexMap<&'a str, MatchedArg>,
#[doc(hidden)]
pub subcommand: Option<Box<SubCommand<'a>>>,
#[doc(hidden)]
@ -72,7 +72,7 @@ pub struct ArgMatches<'a> {
impl<'a> Default for ArgMatches<'a> {
fn default() -> Self {
ArgMatches {
args: OrderMap::new(),
args: IndexMap::new(),
subcommand: None,
usage: None,
}

View file

@ -536,7 +536,7 @@ extern crate ansi_term;
extern crate atty;
#[macro_use]
extern crate bitflags;
extern crate ordermap;
extern crate indexmap;
#[cfg(feature = "suggestions")]
extern crate strsim;
#[cfg(feature = "wrap_help")]