use crate::{IoResult, Path, PathBuf};
use std::path::{MAIN_SEPARATOR, MAIN_SEPARATOR_STR, absolute, is_separator};
trait Sealed {}
impl Sealed for Path {}
impl Sealed for PathBuf {}
#[doc = crate::_tags!(fs)]
#[rustfmt::skip]
#[cfg_attr(nightly_doc, doc(notable_trait))]
#[expect(private_bounds, reason = "Sealed")]
pub trait PathExt: Sealed {
const SEPARATOR: &str = MAIN_SEPARATOR_STR;
const SEPARATOR_CHAR: char = MAIN_SEPARATOR;
fn absolute<P: AsRef<Path>>(path: P) -> IoResult<PathBuf> {
absolute(path)
}
fn to_absolute(&self) -> IoResult<PathBuf>;
#[must_use]
fn is_separator(c: char) -> bool {
is_separator(c)
}
}
impl PathExt for Path {
fn to_absolute(&self) -> IoResult<PathBuf> {
absolute(self)
}
}
impl PathExt for PathBuf {
fn to_absolute(&self) -> IoResult<PathBuf> {
absolute(self)
}
}