Skip to content

Commit

Permalink
refactor: do not use unnecessary Span::raw
Browse files Browse the repository at this point in the history
  • Loading branch information
nik-rev committed Dec 17, 2024
1 parent ee8162d commit 0f254ee
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion helix-term/src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2164,7 +2164,7 @@ fn searcher(cx: &mut Context, direction: Direction) {
completions
.iter()
.filter(|comp| comp.starts_with(input))
.map(|comp| (0.., Span::raw(comp.clone())))
.map(|comp| (0.., comp.clone().into()))
.collect()
},
move |cx, regex, event| {
Expand Down
2 changes: 1 addition & 1 deletion helix-term/src/commands/typed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3178,7 +3178,7 @@ pub(super) fn command_mode(cx: &mut Context) {
false,
)
.into_iter()
.map(|(name, _)| (0.., Span::raw(name)))
.map(|(name, _)| (0.., name.into()))
.collect()
} else {
// Otherwise, use the command's completer and the last shellword
Expand Down
10 changes: 5 additions & 5 deletions helix-term/src/ui/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ pub mod completers {

fuzzy_match(input, names, true)
.into_iter()
.map(|(name, _)| ((0..), Span::raw(name)))
.map(|(name, _)| ((0..), name.into()))
.collect()
}

Expand All @@ -307,7 +307,7 @@ pub mod completers {

fuzzy_match(input, names, false)
.into_iter()
.map(|(name, _)| ((0..), Span::raw(name)))
.map(|(name, _)| ((0..), name.into()))
.collect()
}

Expand Down Expand Up @@ -372,7 +372,7 @@ pub mod completers {

fuzzy_match(input, language_ids, false)
.into_iter()
.map(|(name, _)| ((0..), Span::raw(name.to_owned())))
.map(|(name, _)| ((0..), name.to_owned().into()))
.collect()
}

Expand All @@ -388,7 +388,7 @@ pub mod completers {

fuzzy_match(input, commands, false)
.into_iter()
.map(|(name, _)| ((0..), Span::raw(name.to_owned())))
.map(|(name, _)| ((0..), name.to_owned().into()))
.collect()
}

Expand Down Expand Up @@ -545,7 +545,7 @@ pub mod completers {

fuzzy_match(input, iter, false)
.into_iter()
.map(|(name, _)| ((0..), Span::raw(name)))
.map(|(name, _)| ((0..), name.into()))
.collect()
}
}
2 changes: 1 addition & 1 deletion helix-term/src/ui/prompt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,7 @@ impl Component for Prompt {
.editor
.registers
.iter_preview()
.map(|(ch, preview)| (0.., Span::raw(format!("{} {}", ch, &preview))))
.map(|(ch, preview)| (0.., format!("{} {}", ch, &preview).into()))
.collect();
self.next_char_handler = Some(Box::new(|prompt, c, context| {
prompt.insert_str(
Expand Down

0 comments on commit 0f254ee

Please sign in to comment.