Skip to content
This repository has been archived by the owner on Aug 6, 2023. It is now read-only.

docs: Fix missing code block fence for hidden_legend_constraints #274

Merged
merged 7 commits into from
May 10, 2020
Merged

docs: Fix missing code block fence for hidden_legend_constraints #274

merged 7 commits into from
May 10, 2020

Conversation

ClementTsang
Copy link
Contributor

@ClementTsang ClementTsang commented Apr 18, 2020

Two things:

  1. Minor thing that I noticed when using this function. Seems to look fine in documentation, but looked weird on stuff like VS Code.

image

  1. When using GraphType::Line, if the dataset is empty, you can end up with a subtraction underflow when you do the length - 1.

@ClementTsang
Copy link
Contributor Author

EDIT: This was originally just a documentation fix but I found the GraphType::Line bug soon after... I guess kill two birds with one PR.

@fdehau
Copy link
Owner

fdehau commented May 9, 2020

I think that your fix is the object of an other dedicated PR (#283). So I would happily take the documentation fix in this PR and resolve the overflow bug in the other one.

@ClementTsang
Copy link
Contributor Author

ClementTsang commented May 9, 2020

Ah, my bad. Forgot that I pushed that change temporarily to use in my Cargo. I'll revert the third commit.

The second commit is different from that PR; this is more of a fix for if dataset.data is empty, as for i in 0..dataset.data.len() - 1 {...} occasionally seems to fail otherwise due to underflow.

I can revert that commit as well and do it in a separate PR if that's better.

src/widgets/chart.rs Outdated Show resolved Hide resolved
@fdehau
Copy link
Owner

fdehau commented May 10, 2020

Thanks. No you can left the other bug fix here that's fine. I've left a comment and it would be nice if you could add a small test covering this case as well.

@ClementTsang ClementTsang requested a review from fdehau May 10, 2020 20:56
@fdehau fdehau merged commit b72ced4 into fdehau:master May 10, 2020
@fdehau
Copy link
Owner

fdehau commented May 10, 2020

Thanks !

24seconds pushed a commit to 24seconds/tui-rs that referenced this pull request Nov 30, 2020
* docs: Fix missing code block fence
* use slice::windows to deal with underflow issue
* add test for empty dataset and lines
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants