Skip to content

Commit 966476b

Browse files
lengyijunxFrednet
andauthored
Update clippy_lints/src/pathbuf_init_then_push.rs
Co-authored-by: Fridtjof Stoldt <[email protected]>
1 parent ad8d00c commit 966476b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

clippy_lints/src/pathbuf_init_then_push.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ struct PathbufPushSearcher<'tcx> {
5959
}
6060

6161
impl<'tcx> PathbufPushSearcher<'tcx> {
62-
// try to generate `PathBuf::from`
62+
/// Try to generate a suggestion with `PathBuf::from`.
63+
/// Returns `None` if the suggestion would be invalid.
6364
fn gen_pathbuf_from(&self, cx: &LateContext<'_>) -> Option<String> {
6465
if let ExprKind::Call(iter_expr, []) = &self.init_val.kind
6566
&& let ExprKind::Path(QPath::TypeRelative(ty, segment)) = &iter_expr.kind

0 commit comments

Comments
 (0)