Skip to content

Commit c7d0f2f

Browse files
committed
analyze: rewrite::mir_op: fix comment on OptionDowngrade case
1 parent b16282e commit c7d0f2f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

c2rust-analyze/src/rewrite/expr/mir_op.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,7 @@ where
959959
if from.option && from.own != to.own {
960960
// Downgrade ownership before unwrapping the `Option` when possible. This can avoid
961961
// moving/consuming the input. For example, if the `from` type is `Option<Box<T>>` and
962-
// `to` is `&mut T`, we start by calling `p.as_mut().as_deref()`, which gives
962+
// `to` is `&mut T`, we start by calling `p.as_deref_mut()`, which produces
963963
// `Option<&mut T>` without consuming `p`.
964964
if !from.own.is_copy() {
965965
match to.own {

0 commit comments

Comments
 (0)