Skip to content

Commit

Permalink
Fix comment
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed May 28, 2024
1 parent 877ae3d commit cb148cc
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ fn generate_fix(
.add_end(TextSize::new(1)),
);

// If a literal was provided, insert an assignment.
//
// For example, change `x: Final[Literal[42]]` to `x: Final = 42`.
if let Some(literal) = literal {
// If a literal was provided, insert an assignment.
let assignment = Edit::insertion(
format!(
" = {literal_source}",
Expand All @@ -136,7 +138,6 @@ fn generate_fix(
);
Fix::safe_edits(deletion, std::iter::once(assignment))
} else {
// If no literal exists, we can remove the assignment.
Fix::safe_edit(deletion)
}
}

0 comments on commit cb148cc

Please sign in to comment.