Repository navigation
refactor(width): one Width type for --width, the config file and Args - #37
Merged
Merged
Conversation
Replaces Args.width: Option<u16> plus Args.full_width: bool with
Args.width: Width { Auto, Columns(n), Full }, shared by the CLI parser and
the config file, and adds Default for Args so library callers can write
Args { width, ..Default::default() } and stop breaking when fields are added.
The config file now takes the --width keywords: width = "full", "wide"
or "narrow" (previously only a number; strings were rejected).
Credits @narma in the README for #34.
Merged
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #34.
Args.widthis nowink_md::Width { Auto, Columns(n), Full }(#[non_exhaustive]) instead ofOption<u16>plusfull_width: bool. One parser,Width::parse, serves--widthand the config file.ArgsimplementsDefault, so library callers can writeArgs { width, ..Default::default() }and new fields stop breaking them.width = "full","wide"and"narrow"as well as a number. Bad values warn and are ignored.Breaking for library users, so this goes out in 0.12.0.