diff options
author | Blaž Hrastnik | 2020-09-28 16:00:35 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2020-09-28 16:00:35 +0000 |
commit | 3020077da8efbf914a9cb0a2cbb50362d339a39a (patch) | |
tree | af8eaf9c016ac5116f6349a6b5ebb79e77f8efb5 /helix-syntax | |
parent | fbe313779e83728b7dca7925df722c7fb4228d98 (diff) |
Extend selection commands.
Diffstat (limited to 'helix-syntax')
-rw-r--r-- | helix-syntax/Cargo.toml | 2 | ||||
-rw-r--r-- | helix-syntax/src/lib.rs | 8 |
2 files changed, 6 insertions, 4 deletions
diff --git a/helix-syntax/Cargo.toml b/helix-syntax/Cargo.toml index ef8ed863..61a9b5b0 100644 --- a/helix-syntax/Cargo.toml +++ b/helix-syntax/Cargo.toml @@ -7,7 +7,7 @@ edition = "2018" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -tree-sitter = "0.16" +tree-sitter = "0.17" enum-iterator = "0.6" [build-dependencies] diff --git a/helix-syntax/src/lib.rs b/helix-syntax/src/lib.rs index 60472fdd..61d63273 100644 --- a/helix-syntax/src/lib.rs +++ b/helix-syntax/src/lib.rs @@ -13,7 +13,7 @@ macro_rules! mk_extern { #[macro_export] macro_rules! mk_enum { ( $( $camel:ident ),* ) => { - #[derive(Clone, Debug, IntoEnumIterator, PartialEq)] + #[derive(Clone, Copy, Debug, IntoEnumIterator, PartialEq)] pub enum LANG { $( $camel, @@ -25,7 +25,8 @@ macro_rules! mk_enum { #[macro_export] macro_rules! mk_get_language { ( $( ($camel:ident, $name:ident) ),* ) => { - pub fn get_language(lang: &LANG) -> Language { + #[must_use] + pub fn get_language(lang: LANG) -> Language { unsafe { match lang { $( @@ -40,7 +41,8 @@ macro_rules! mk_get_language { #[macro_export] macro_rules! mk_get_language_name { ( $( $camel:ident ),* ) => { - pub fn get_language_name(lang: &LANG) -> &'static str { + #[must_use] + pub const fn get_language_name(lang: LANG) -> &'static str { match lang { $( LANG::$camel => stringify!($camel), |