You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the following example rustfmt removes the leading parenthesis in F: (Fn(&T) -> String) but doesn't remove the closing parenthesis (but does add some spacing).
fnmake_map<T,F:(Fn(&T) -> String)>(records:&Vec<T>,key_fn:F) -> HashMap<String,usize>{
records
.iter().enumerate().map(|(index, record)| (key_fn(record), index)).collect()}
The text was updated successfully, but these errors were encountered:
The problem here is that the AST node of TyParamBound does not hold information about parenthesis in its field nor span, and rustfmt incorrectly assumes that the closing parenthesis is some kind of comments.
In the following example rustfmt removes the leading parenthesis in
F: (Fn(&T) -> String)
but doesn't remove the closing parenthesis (but does add some spacing).The text was updated successfully, but these errors were encountered: