Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix rendering problem with a superscript bigger than 10 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
clearloop merged 2 commits into clearloop:master from heeh:master
Jun 8, 2021
Merged

Fix rendering problem with a superscript bigger than 10 #39

clearloop merged 2 commits into clearloop:master from heeh:master
Jun 8, 2021

Conversation

Copy link
Contributor

@heeh heeh commented Jun 7, 2021
edited
Loading

The issue #38 is caused by the code at helper.rs#L126

  1. superscript(n / 10).parse().unwrap_or(0) and superscript(n % 10).parse().unwrap_or(0) always fail.
  2. This happens because parse function does not know the output type. It fails and we get 0 instead of 31 as in leetcode pick: wrong constraints #38 .
  3. Even if you use parse::<u32>(), parsing a superscript(e.g. 3 ) produces invalid digit error.

I believe that you want to concatenate two superscripts here.
This commit produces a valid representation.

ex) -231 <= num <= 231 - 1

clearloop reacted with heart emoji clearloop reacted with rocket emoji
Copy link
Contributor Author

heeh commented Jun 7, 2021
edited
Loading

This is #37.

You set up the rust toolchain correctly(https://github.com/clearloop/leetcode-cli/blob/master/rust-toolchain#L1)
However, the following workflows invoke rustc 1.54.0-nightly (35fff69d0 2021年06月06日) instead of rustc 1.54.0-nightly (8cf990c9b 2021年05月15日)

There are two possible fixes.

  1. Make workflow files explicitly use nightly-2021年05月16日
  2. Fix cannot find type NoneError in module std::option #37

I committed the first fix.

clearloop reacted with thumbs up emoji

@clearloop clearloop merged commit a03f7b0 into clearloop:master Jun 8, 2021
Copy link
Owner

Thanks!! @heeh! just published v0.3.7 🚀

heeh reacted with hooray emoji

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /