From 746bf48ec4493425959a839643a637eda00cab39 Mon Sep 17 00:00:00 2001 From: Caleb Cartwright Date: Sun, 22 Oct 2023 12:59:03 -0500 Subject: [PATCH] chore: bump toolchain and apply minor updates --- rust-toolchain | 2 +- src/comment.rs | 31 ------------------------------- src/expr.rs | 2 +- src/pairs.rs | 4 ++-- 4 files changed, 4 insertions(+), 35 deletions(-) diff --git a/rust-toolchain b/rust-toolchain index 33ff8b03da2..0057e2f370a 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2023-07-01" +channel = "nightly-2023-10-22" components = ["llvm-tools", "rustc-dev"] diff --git a/src/comment.rs b/src/comment.rs index f7957321464..7da0f79bd09 100644 --- a/src/comment.rs +++ b/src/comment.rs @@ -2074,28 +2074,6 @@ fn main() { expected_line_start: &str, ) { let block = ItemizedBlock::new(test_input).unwrap(); -<<<<<<< HEAD - assert_eq!(1, block.lines.len(), "test_input: {:?}", test_input); - assert_eq!( - expected_line, &block.lines[0], - "test_input: {:?}", - test_input - ); - assert_eq!( - expected_indent, block.indent, - "test_input: {:?}", - test_input - ); - assert_eq!( - expected_opener, &block.opener, - "test_input: {:?}", - test_input - ); - assert_eq!( - expected_line_start, &block.line_start, - "test_input: {:?}", - test_input -======= assert_eq!(1, block.lines.len(), "test_input: {test_input:?}"); assert_eq!(expected_line, &block.lines[0], "test_input: {test_input:?}"); assert_eq!(expected_indent, block.indent, "test_input: {test_input:?}"); @@ -2103,7 +2081,6 @@ fn main() { assert_eq!( expected_line_start, &block.line_start, "test_input: {test_input:?}" ->>>>>>> upstream/master ); } @@ -2155,23 +2132,15 @@ fn main() { // https://spec.commonmark.org/0.30 says: "A start number may not be negative": "-1. Not a list item.", "-1 Not a list item.", -<<<<<<< HEAD -======= // Marker without prefix are not recognized as item markers: ". Not a list item.", ") Not a list item.", ->>>>>>> upstream/master ]; for line in test_inputs.iter() { let maybe_block = ItemizedBlock::new(line); assert!( maybe_block.is_none(), -<<<<<<< HEAD - "The following line shouldn't be classified as a list item: {}", - line -======= "The following line shouldn't be classified as a list item: {line}" ->>>>>>> upstream/master ); } } diff --git a/src/expr.rs b/src/expr.rs index 878e2b7d6d0..acde8809329 100644 --- a/src/expr.rs +++ b/src/expr.rs @@ -132,7 +132,7 @@ pub(crate) fn format_expr( ast::ExprKind::Tup(ref items) => { rewrite_tuple(context, items.iter(), expr.span, shape, items.len() == 1) } - ast::ExprKind::Let(ref pat, ref expr, _span) => rewrite_let(context, shape, pat, expr), + ast::ExprKind::Let(ref pat, ref expr, _span, _) => rewrite_let(context, shape, pat, expr), ast::ExprKind::If(..) | ast::ExprKind::ForLoop(..) | ast::ExprKind::Loop(..) diff --git a/src/pairs.rs b/src/pairs.rs index 9dac20d3699..07c05193739 100644 --- a/src/pairs.rs +++ b/src/pairs.rs @@ -274,7 +274,7 @@ impl<'a, 'b> PairList<'a, 'b, ast::Expr> { fn let_chain_count(&self) -> usize { self.list .iter() - .filter(|(expr, _)| matches!(expr.kind, ast::ExprKind::Let(_, _, _))) + .filter(|(expr, _)| matches!(expr.kind, ast::ExprKind::Let(..))) .count() } @@ -284,7 +284,7 @@ impl<'a, 'b> PairList<'a, 'b, ast::Expr> { } let fist_item_is_ident = is_ident(self.list[0].0); - let second_item_is_let_chain = matches!(self.list[1].0.kind, ast::ExprKind::Let(_, _, _)); + let second_item_is_let_chain = matches!(self.list[1].0.kind, ast::ExprKind::Let(..)); fist_item_is_ident && second_item_is_let_chain }