Fixed a rustfmt tab-related bug, updated dependencies and fixed breaking changes to their APIs#105
Open
NotGyro wants to merge 7 commits intokurtlawrence:masterfrom
Open
Fixed a rustfmt tab-related bug, updated dependencies and fixed breaking changes to their APIs#105NotGyro wants to merge 7 commits intokurtlawrence:masterfrom
NotGyro wants to merge 7 commits intokurtlawrence:masterfrom
Conversation
…ng changes in depencencies.
kurtlawrence
requested changes
Oct 23, 2021
Owner
kurtlawrence
left a comment
There was a problem hiding this comment.
Thanks for the PR!
It looks good, I just have a few changes I would like before I merge it in.
| let reterr = |e: syn::Error| { | ||
| let e = e.to_string(); | ||
| if &e == "LexError" { | ||
| if (&e == "LexError") || (&e == "lex error") { |
| } | ||
| .saturating_sub(repl.prompt(false).chars().count()); | ||
| fmt.width_limit = Some(width); | ||
| fmt.width_limit = Some(width.try_into().unwrap()); |
Owner
There was a problem hiding this comment.
Since .try_into() may fail, and .width_limit is an option anyway, we should let the failure become None rather than possibly panicking:
fmt.width_limit = width.try_into().ok();
| crossterm::ErrorKind::IoError(e) => e, | ||
| _ => io::Error::new(io::ErrorKind::Other, msg), | ||
| } | ||
| fn map_xterm_err(xtermerr: crossterm::ErrorKind, _msg: &str) -> io::Error { |
Owner
There was a problem hiding this comment.
Could you please add a TODO item to remove this function. (or remove it if you want)
|
|
||
| let ev = interface.read_until(STOPEVENTS)?; | ||
|
|
||
| match (ev, verbatim_mode) { |
Owner
There was a problem hiding this comment.
Is there a particular reason to not use match syntax? I find it more readable than if else expressions.
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.
Hello, this set of commits fixes a few issues - most prominently,
reduce_indent()expects blocks to be indented by four tabs in order to work properly, but setting.rustfmt.toml with "hard_tabs = true".rustfmt.toml in a project which embeds papyrus would cause blocks to be indented with a \t, breaking this method.In addition, the versions of several dependencies were bumped. This broke a few things, but most notably parse_program() searches for the string "LexError" to detect a certain result while that syn::parse_str() error is now displayed as "lex error". This case is now checked for.