diff options
author | Blaž Hrastnik | 2021-10-24 08:28:29 +0000 |
---|---|---|
committer | Blaž Hrastnik | 2021-10-24 08:28:29 +0000 |
commit | cee7ad781e5f6de249d728425a6283a26bb62dc3 (patch) | |
tree | 94e2b87ec0a4677a3f85a951519a7b4263bbef54 /helix-core/src/line_ending.rs | |
parent | c913bade0a3b0edaaf87e1a5e795edc951cead78 (diff) |
Mark a few functions as `const`
Diffstat (limited to 'helix-core/src/line_ending.rs')
-rw-r--r-- | helix-core/src/line_ending.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/helix-core/src/line_ending.rs b/helix-core/src/line_ending.rs index 18ea5f9f..3541305c 100644 --- a/helix-core/src/line_ending.rs +++ b/helix-core/src/line_ending.rs @@ -20,7 +20,7 @@ pub enum LineEnding { impl LineEnding { #[inline] - pub fn len_chars(&self) -> usize { + pub const fn len_chars(&self) -> usize { match self { Self::Crlf => 2, _ => 1, @@ -28,7 +28,7 @@ impl LineEnding { } #[inline] - pub fn as_str(&self) -> &'static str { + pub const fn as_str(&self) -> &'static str { match self { Self::Crlf => "\u{000D}\u{000A}", Self::LF => "\u{000A}", @@ -42,7 +42,7 @@ impl LineEnding { } #[inline] - pub fn from_char(ch: char) -> Option<LineEnding> { + pub const fn from_char(ch: char) -> Option<LineEnding> { match ch { '\u{000A}' => Some(LineEnding::LF), '\u{000B}' => Some(LineEnding::VT), |