pub struct EolNormalizer;Expand description
EOL (End of Line) detection and normalization utilities.
Implementations§
Source§impl EolNormalizer
impl EolNormalizer
Sourcepub fn detect_eol(file_path: &Path) -> Result<String>
pub fn detect_eol(file_path: &Path) -> Result<String>
Detect the EOL style used in a file.
Returns the EOL string used in the file, or the platform default if no EOL is detected or the file is empty.
Sourcepub fn detect_eol_from_content(content: &str) -> Result<String>
pub fn detect_eol_from_content(content: &str) -> Result<String>
Detect EOL from file content.
Sourcepub fn platform_default() -> String
pub fn platform_default() -> String
Get the platform default EOL.
Sourcepub fn normalize_to_eol(content: &str, target_eol: &str) -> String
pub fn normalize_to_eol(content: &str, target_eol: &str) -> String
Normalize content to use the specified EOL.
Auto Trait Implementations§
impl Freeze for EolNormalizer
impl RefUnwindSafe for EolNormalizer
impl Send for EolNormalizer
impl Sync for EolNormalizer
impl Unpin for EolNormalizer
impl UnwindSafe for EolNormalizer
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