refactor: simplify get_height_of_terminal() and get_width...#436
Merged
Conversation
Contributor
|
I think my original idea was that we'd just use the |
Contributor
Author
|
Then that's out of my current Rust knowledge. Sorry, I'm closing this PR. |
Owner
|
I think its easier to convert to usize as I start doing math with it. eg: For height I use it to work out how many rows I can have displayed on the terminal. I'd be happy to accept this pr as I think using |
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.
The eminence/terminal-size#41 PR mentioned in comments of
get_(height|width)_of_terminal()(added by c36ca33)dust/src/main.rs
Lines 83 to 91 in b636086
has been merged and shipped since
terminal-sizev0.2.2. As we're usingterminal-sizev0.2.6 now, it's time to simplify them.dust/Cargo.lock
Lines 766 to 768 in 38c4d23
Not sure if I made it to the most simplified form, as I can hardly speak Rust.
cc @Lucretiel