Inline perform_rename_impl as its only used in one spot (#23013)

Also removes a redundant use of `to_point_utf16`.

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-01-11 14:58:35 -07:00 committed by GitHub
parent 65c38f22f9
commit de2e197ad9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2934,14 +2934,14 @@ impl Project {
self.prepare_rename_impl(buffer, position, cx)
}
fn perform_rename_impl(
pub fn perform_rename<T: ToPointUtf16>(
&mut self,
buffer: Model<Buffer>,
position: PointUtf16,
position: T,
new_name: String,
push_to_history: bool,
cx: &mut ModelContext<Self>,
) -> Task<Result<ProjectTransaction>> {
let push_to_history = true;
let position = position.to_point_utf16(buffer.read(cx));
self.request_lsp(
buffer,
@ -2955,17 +2955,6 @@ impl Project {
)
}
pub fn perform_rename<T: ToPointUtf16>(
&mut self,
buffer: Model<Buffer>,
position: T,
new_name: String,
cx: &mut ModelContext<Self>,
) -> Task<Result<ProjectTransaction>> {
let position = position.to_point_utf16(buffer.read(cx));
self.perform_rename_impl(buffer, position, new_name, true, cx)
}
pub fn on_type_format<T: ToPointUtf16>(
&mut self,
buffer: Model<Buffer>,