aboutsummaryrefslogtreecommitdiff
path: root/helix-core/src/line_ending.rs
diff options
context:
space:
mode:
authorBlaž Hrastnik2021-11-06 15:28:19 +0000
committerBlaž Hrastnik2021-11-06 15:28:19 +0000
commitf2b709a3c3a9cc036bfea46734efd7e4100eb34b (patch)
treead5f921f13659e5ba395442e13389af317ee81b0 /helix-core/src/line_ending.rs
parentcde57dae356021c6ca8c2a2ed68777bd9d0bc0b2 (diff)
parentf979bdc442ab3150a369ff8bee0703e90e32e2a4 (diff)
Merge branch 'master' into debug
Diffstat (limited to 'helix-core/src/line_ending.rs')
-rw-r--r--helix-core/src/line_ending.rs6
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),