pub enum EolFlavor {
Lf,
CrLf,
}Expand description
The line-ending flavor detected at load; consulted only by
Buffer::serialize. Internal text is always LF.
Detection is a majority vote over the file’s terminators, matching VS
Code: CrLf iff CRLF terminators strictly outnumber LF ones, so a tie
goes to Lf — including the no-terminator case (an empty or one-line
file). A lone \r is normalized to \n but casts no vote. Saving in the
detected flavor therefore round-trips a uniformly terminated file
byte-for-byte and rewrites only the minority lines of a mixed one.
Variants§
Trait Implementations§
impl Copy for EolFlavor
impl Eq for EolFlavor
impl StructuralPartialEq for EolFlavor
Auto Trait Implementations§
impl Freeze for EolFlavor
impl RefUnwindSafe for EolFlavor
impl Send for EolFlavor
impl Sync for EolFlavor
impl Unpin for EolFlavor
impl UnsafeUnpin for EolFlavor
impl UnwindSafe for EolFlavor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.