aboutsummaryrefslogtreecommitdiff
path: root/helix-core
diff options
context:
space:
mode:
Diffstat (limited to 'helix-core')
-rw-r--r--helix-core/src/indent.rs2
-rw-r--r--helix-core/src/syntax.rs6
2 files changed, 4 insertions, 4 deletions
diff --git a/helix-core/src/indent.rs b/helix-core/src/indent.rs
index 1e90db47..c29bb3a0 100644
--- a/helix-core/src/indent.rs
+++ b/helix-core/src/indent.rs
@@ -551,7 +551,7 @@ fn query_indents<'a>(
// The row/column position of the optional anchor in this query
let mut anchor: Option<tree_sitter::Node> = None;
for capture in m.captures {
- let capture_name = query.capture_names()[capture.index as usize].as_str();
+ let capture_name = query.capture_names()[capture.index as usize];
let capture_type = match capture_name {
"indent" => IndentCaptureType::Indent,
"indent.always" => IndentCaptureType::IndentAlways,
diff --git a/helix-core/src/syntax.rs b/helix-core/src/syntax.rs
index 102ecb15..4e44c486 100644
--- a/helix-core/src/syntax.rs
+++ b/helix-core/src/syntax.rs
@@ -1727,7 +1727,7 @@ impl HighlightConfiguration {
let mut local_scope_capture_index = None;
for (i, name) in query.capture_names().iter().enumerate() {
let i = Some(i as u32);
- match name.as_str() {
+ match *name {
"local.definition" => local_def_capture_index = i,
"local.definition-value" => local_def_value_capture_index = i,
"local.reference" => local_ref_capture_index = i,
@@ -1738,7 +1738,7 @@ impl HighlightConfiguration {
for (i, name) in injections_query.capture_names().iter().enumerate() {
let i = Some(i as u32);
- match name.as_str() {
+ match *name {
"injection.content" => injection_content_capture_index = i,
"injection.language" => injection_language_capture_index = i,
"injection.filename" => injection_filename_capture_index = i,
@@ -1768,7 +1768,7 @@ impl HighlightConfiguration {
}
/// Get a slice containing all of the highlight names used in the configuration.
- pub fn names(&self) -> &[String] {
+ pub fn names(&self) -> &[&str] {
self.query.capture_names()
}