This commit is contained in:
A4-Tacks 2025-08-27 23:01:36 +09:00 committed by GitHub
commit 54205ed1d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 1106 additions and 0 deletions

File diff suppressed because it is too large Load diff

View file

@ -184,6 +184,7 @@ mod handlers {
mod introduce_named_type_parameter;
mod invert_if;
mod merge_imports;
mod merge_let_stmts;
mod merge_match_arms;
mod merge_nested_if;
mod move_bounds;
@ -322,6 +323,7 @@ mod handlers {
merge_imports::merge_imports,
merge_match_arms::merge_match_arms,
merge_nested_if::merge_nested_if,
merge_let_stmts::merge_let_stmts,
move_bounds::move_bounds_to_where_clause,
move_const_to_impl::move_const_to_impl,
move_from_mod_rs::move_from_mod_rs,

View file

@ -2450,6 +2450,42 @@ use std::{fmt::Formatter, io};
)
}
#[test]
fn doctest_merge_let_stmts() {
check_doc_test(
"merge_let_stmts",
r#####"
fn main() {
$0let a = 2;
let b = 3;$0
}
"#####,
r#####"
fn main() {
let (a, b) = (2, 3);
}
"#####,
)
}
#[test]
fn doctest_merge_let_stmts_1() {
check_doc_test(
"merge_let_stmts",
r#####"
fn main() {
$0let a: i32 = 2;
let b = 3;
}
"#####,
r#####"
fn main() {
let (a, b): (i32, _) = (2, 3);
}
"#####,
)
}
#[test]
fn doctest_merge_match_arms() {
check_doc_test(