Skip to content

Commit

Permalink
chore: bump toolchain and apply minor updates
Browse files Browse the repository at this point in the history
  • Loading branch information
calebcartwright committed Oct 22, 2023
1 parent f35f252 commit 746bf48
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 35 deletions.
2 changes: 1 addition & 1 deletion rust-toolchain
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[toolchain]
channel = "nightly-2023-07-01"
channel = "nightly-2023-10-22"
components = ["llvm-tools", "rustc-dev"]
31 changes: 0 additions & 31 deletions src/comment.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2074,36 +2074,13 @@ 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:?}");
assert_eq!(expected_opener, &block.opener, "test_input: {test_input:?}");
assert_eq!(
expected_line_start, &block.line_start,
"test_input: {test_input:?}"
>>>>>>> upstream/master
);
}

Expand Down Expand Up @@ -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
);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(..)
Expand Down
4 changes: 2 additions & 2 deletions src/pairs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand All @@ -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
}
Expand Down

0 comments on commit 746bf48

Please sign in to comment.