Commit graph

27 commits

Author SHA1 Message Date
Pavan Kumar Sunkara
33f47acc67 Refactor clap_generate 2020-02-07 07:52:04 +01:00
Pavan Kumar Sunkara
8e4a189ab0 fmt: Use standardized rustfmt rules 2020-01-31 18:37:56 +01:00
danieleades
af45420027 style: format code with rustfmt (#1632)
> incidentally, how do we feel about adding a rustfmt check to the CI(s)?
yes we should be doing that. you can send another pr that adds the check to the Ci
2020-01-11 23:45:46 +05:30
Jeremy Stucki
2e1acb648c Refactor mkeymap (#1618)
* refactor(mkeymap): Use iterators

* refactor(mkeymap): Implement contains method

* refactor(mkeymap): Deprecate methods

Co-authored-by: Dylan DPC <dylan.dpc@gmail.com>
2020-01-09 23:00:22 +05:30
Dylan DPC
dd6c8e08ad use 2018 edition and minor refactors 2019-11-11 12:54:55 +01:00
Tyler Ruckinger
a5e3e62bef test in mkeymap does not need #[should_panic] 2019-06-25 19:51:12 -04:00
Erick Tryzelaar
2664703587 Fix most warnings
This patch:

* Removes unused `App::contains_long`
* Removes `std::ascii::AsciiExt` (deprecated in 1.26)
* Replaces `trim_left_matches` with `trim_start_matches` (added in 1.30)
* Adds `dyn` (added in 1.27)
* Removes unused `mkeymap::KeyType::{is_short,is_long}`
* Cleans up unused imports
2019-06-19 15:47:50 -07:00
Kevin K
958437661a
chore: clippy fixes 2019-04-05 20:21:34 -04:00
Kevin K
573b0a9e88
chore: upgrades to 2018 edition of Rust 2019-04-05 20:21:30 -04:00
Kevin K
4cc85990fd
refactor: removed strings as an internal ID for arguments, groups, and
subcommands

This commit changes the internal ID to a u64 which will allow for
greater optimizations down the road. In addition, it lays the ground
work for allowing users to use things like enum variants as argument
keys instead of strings.

The only downside is each key needs to be hashed (the implementation
used is an FNV hasher for performance). However, the performance gains
in faster iteration, comparison, etc. should easily outweigh the single
hash of each argument.

Another benefit of if this commit is the removal of several lifetime
parameters, as it stands Arg and App now only have a single lifetime
parameter, and ArgMatches and ArgGroup have no lifetime parameter.
2019-04-05 20:21:22 -04:00
Kevin K
eafee3c5c1 style: cargo fmt run 2018-11-14 14:01:48 -05:00
Kevin K
2a480451d3 refactor: clippy run 2018-11-14 14:01:48 -05:00
Kevin K
20c72525d2 style: cargo fmt run 2018-11-14 12:05:06 -05:00
Kevin K
0de9e07412
Merge branch 'v3-master' into map 2018-11-13 22:07:16 -05:00
Kevin K
99bd101ea7
tests: fixes did_you_mean tests 2018-08-27 21:44:09 -04:00
Kevin K
400fafade2
tests: fixes help tests 2018-08-27 20:25:37 -04:00
Kevin K
d90186d3bb
tests: fixes mkeymap tests 2018-08-20 20:28:51 -04:00
Kevin K
6c5d4c5896
tests: fixes the app_settings tests 2018-08-20 20:23:52 -04:00
Alena Yuryeva
b48ef85ece fixed unique_args tests 2018-08-11 21:32:06 +03:00
Alena Yuryeva
c501773ed3 Tests on flags passing 2018-08-11 20:34:40 +03:00
Alena Yuryeva
87c88d6054
Arg-specific API for MKeyMap 2018-08-04 18:37:35 -04:00
Kevin K
a75b67838e
refactor(Suggestions): changes from string slice to owned string for return values
The return value is only used in the error case, and only a single
String allocation, therefore the complexities introduced by using string
slices isn't worth it. clap primarily only needs to be as fast as
possible in the happy path, the error path can afford additional
allocations.
2018-08-04 18:34:54 -04:00
Alena Yuryeva
272170e333
WIP 2018-08-04 18:32:08 -04:00
Alena Yuryeva
f230cfedc3
WIP 2018-08-04 18:26:33 -04:00
Alena Yuryeva
7e5a6935b9
WIP. Big reformat 2018-08-04 18:22:10 -04:00
Alena Yuryeva
7faf6c7721
MkeyMap API changes 2018-08-04 18:13:34 -04:00
Alena Yuryeva
3efcf3ae03
WIP changing macros into MKeyMap calls 2018-08-04 18:13:33 -04:00