Add test case for blocks with semicolon inside and outside a block
This commit is contained in:
parent
f62eab4312
commit
20ec2ceab8
@ -8,11 +8,13 @@ use rustc_span::Span;
|
|||||||
declare_clippy_lint! {
|
declare_clippy_lint! {
|
||||||
/// ### What it does
|
/// ### What it does
|
||||||
///
|
///
|
||||||
/// Suggests moving the semicolon from a block inside of the block to its kast expression.
|
/// Suggests moving the semicolon after a block to the inside of the block, after its last
|
||||||
|
/// expression.
|
||||||
///
|
///
|
||||||
/// ### Why is this bad?
|
/// ### Why is this bad?
|
||||||
///
|
///
|
||||||
/// For consistency it's best to have the semicolon inside/outside the block. Either way is fine and this lint suggests inside the block.
|
/// For consistency it's best to have the semicolon inside/outside the block. Either way is fine
|
||||||
|
/// and this lint suggests inside the block.
|
||||||
/// Take a look at `semicolon_outside_block` for the other alternative.
|
/// Take a look at `semicolon_outside_block` for the other alternative.
|
||||||
///
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
@ -40,7 +42,8 @@ declare_clippy_lint! {
|
|||||||
///
|
///
|
||||||
/// ### Why is this bad?
|
/// ### Why is this bad?
|
||||||
///
|
///
|
||||||
/// For consistency it's best to have the semicolon inside/outside the block. Either way is fine and this lint suggests outside the block.
|
/// For consistency it's best to have the semicolon inside/outside the block. Either way is fine
|
||||||
|
/// and this lint suggests outside the block.
|
||||||
/// Take a look at `semicolon_inside_block` for the other alternative.
|
/// Take a look at `semicolon_inside_block` for the other alternative.
|
||||||
///
|
///
|
||||||
/// ### Example
|
/// ### Example
|
||||||
|
@ -79,5 +79,7 @@ fn main() {
|
|||||||
unit_fn_block()
|
unit_fn_block()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
{ unit_fn_block(); };
|
||||||
|
|
||||||
unit_fn_block()
|
unit_fn_block()
|
||||||
}
|
}
|
||||||
|
@ -79,5 +79,7 @@ fn main() {
|
|||||||
unit_fn_block()
|
unit_fn_block()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
{ unit_fn_block(); };
|
||||||
|
|
||||||
unit_fn_block()
|
unit_fn_block()
|
||||||
}
|
}
|
||||||
|
@ -79,5 +79,7 @@ fn main() {
|
|||||||
unit_fn_block()
|
unit_fn_block()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
{ unit_fn_block(); };
|
||||||
|
|
||||||
unit_fn_block()
|
unit_fn_block()
|
||||||
}
|
}
|
||||||
|
@ -79,5 +79,7 @@ fn main() {
|
|||||||
unit_fn_block()
|
unit_fn_block()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
{ unit_fn_block(); };
|
||||||
|
|
||||||
unit_fn_block()
|
unit_fn_block()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user