@@ -20,7 +20,7 @@ pub enum LineEnding {
21impl LineEnding {
21impl LineEnding {
23− pub fn len_chars(&self) -> usize {
23+ pub const fn len_chars(&self) -> usize {
24 match self {
24 match self {
25 Self::Crlf => 2,
25 Self::Crlf => 2,
@@ -28,7 +28,7 @@ impl LineEnding {
31− pub fn as_str(&self) -> &'static str {
31+ pub const fn as_str(&self) -> &'static str {
32 match self {
32 match self {
33 Self::Crlf => "\u{000D}\u{000A}",
33 Self::Crlf => "\u{000D}\u{000A}",
34 Self::LF => "\u{000A}",
34 Self::LF => "\u{000A}",
@@ -42,7 +42,7 @@ impl LineEnding {
45− pub fn from_char(ch: char) -> Option<LineEnding> {
45+ pub const fn from_char(ch: char) -> Option<LineEnding> {
46 match ch {
46 match ch {
47 '\u{000A}' => Some(LineEnding::LF),
47 '\u{000A}' => Some(LineEnding::LF),
48 '\u{000B}' => Some(LineEnding::VT),
48 '\u{000B}' => Some(LineEnding::VT),