mirror of
https://github.com/zed-industries/zed.git
synced 2024-12-30 22:34:41 +03:00
Update name of function to match other implementation
This commit is contained in:
parent
c0c0abae56
commit
52f7f2d770
@ -8,7 +8,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
pub fn change_case(_: &mut Workspace, _: &ChangeCase, cx: &mut ViewContext<Workspace>) {
|
pub fn change_case(_: &mut Workspace, _: &ChangeCase, cx: &mut ViewContext<Workspace>) {
|
||||||
transform_case(cx, |c| {
|
manipulate_text(cx, |c| {
|
||||||
if c.is_lowercase() {
|
if c.is_lowercase() {
|
||||||
c.to_uppercase().collect::<Vec<char>>()
|
c.to_uppercase().collect::<Vec<char>>()
|
||||||
} else {
|
} else {
|
||||||
@ -22,7 +22,7 @@ pub fn convert_to_upper_case(
|
|||||||
_: &ConvertToUpperCase,
|
_: &ConvertToUpperCase,
|
||||||
cx: &mut ViewContext<Workspace>,
|
cx: &mut ViewContext<Workspace>,
|
||||||
) {
|
) {
|
||||||
transform_case(cx, |c| c.to_uppercase().collect::<Vec<char>>())
|
manipulate_text(cx, |c| c.to_uppercase().collect::<Vec<char>>())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn convert_to_lower_case(
|
pub fn convert_to_lower_case(
|
||||||
@ -30,10 +30,10 @@ pub fn convert_to_lower_case(
|
|||||||
_: &ConvertToLowerCase,
|
_: &ConvertToLowerCase,
|
||||||
cx: &mut ViewContext<Workspace>,
|
cx: &mut ViewContext<Workspace>,
|
||||||
) {
|
) {
|
||||||
transform_case(cx, |c| c.to_lowercase().collect::<Vec<char>>())
|
manipulate_text(cx, |c| c.to_lowercase().collect::<Vec<char>>())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn transform_case<F>(cx: &mut ViewContext<Workspace>, transform: F)
|
fn manipulate_text<F>(cx: &mut ViewContext<Workspace>, transform: F)
|
||||||
where
|
where
|
||||||
F: Fn(char) -> Vec<char> + Copy,
|
F: Fn(char) -> Vec<char> + Copy,
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user