We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5a6822c commit 003fc73Copy full SHA for 003fc73
src/items.rs
@@ -1816,12 +1816,9 @@ impl Rewrite for ast::FunctionRetTy {
1816
}
1817
1818
1819
-fn is_empty_infer(context: &RewriteContext, ty: &ast::Ty) -> bool {
+fn is_empty_infer(ty: &ast::Ty, pat_span: Span) -> bool {
1820
match ty.node {
1821
- ast::TyKind::Infer => {
1822
- let original = context.snippet(ty.span);
1823
- original != "_"
1824
- }
+ ast::TyKind::Infer => ty.span.hi() == pat_span.hi(),
1825
_ => false,
1826
1827
@@ -1833,7 +1830,7 @@ impl Rewrite for ast::Arg {
1833
1830
.pat
1834
1831
.rewrite(context, Shape::legacy(shape.width, shape.indent))?;
1835
1832
1836
- if !is_empty_infer(context, &*self.ty) {
+ if !is_empty_infer(&*self.ty, self.pat.span) {
1837
if context.config.space_before_colon() {
1838
result.push_str(" ");
1839
0 commit comments