summaryrefslogtreecommitdiff
path: root/helix-syntax/src
diff options
context:
space:
mode:
authorBlaž Hrastnik2020-09-28 16:00:35 +0000
committerBlaž Hrastnik2020-09-28 16:00:35 +0000
commit3020077da8efbf914a9cb0a2cbb50362d339a39a (patch)
treeaf8eaf9c016ac5116f6349a6b5ebb79e77f8efb5 /helix-syntax/src
parentfbe313779e83728b7dca7925df722c7fb4228d98 (diff)
Extend selection commands.
Diffstat (limited to 'helix-syntax/src')
-rw-r--r--helix-syntax/src/lib.rs8
1 files changed, 5 insertions, 3 deletions
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),