pub struct WhitespaceCleaner;Implementations§
Source§impl WhitespaceCleaner
impl WhitespaceCleaner
Sourcepub fn clean_project<P: AsRef<Path>>(dir: P) -> Result<()>
pub fn clean_project<P: AsRef<Path>>(dir: P) -> Result<()>
Skanuje i czyści białe znaki (istniejąca metoda)
Examples found in repository?
examples/fmt.rs (line 9)
4fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let targets = ["./src", "./examples"];
6
7 // 1. Najpierw usuwamy "złe" spacje, przez które fmt wywala błędy
8 for target in targets {
9 WhitespaceCleaner::clean_project(target)?;
10 }
11
12 // 2. Teraz, gdy pliki są "czyste", puszczamy oficjalny formatter
13 WhitespaceCleaner::run_cargo_fmt()?;
14
15 Ok(())
16}Sourcepub fn run_cargo_fmt() -> Result<()>
pub fn run_cargo_fmt() -> Result<()>
Examples found in repository?
examples/fmt.rs (line 13)
4fn main() -> Result<(), Box<dyn std::error::Error>> {
5 let targets = ["./src", "./examples"];
6
7 // 1. Najpierw usuwamy "złe" spacje, przez które fmt wywala błędy
8 for target in targets {
9 WhitespaceCleaner::clean_project(target)?;
10 }
11
12 // 2. Teraz, gdy pliki są "czyste", puszczamy oficjalny formatter
13 WhitespaceCleaner::run_cargo_fmt()?;
14
15 Ok(())
16}Auto Trait Implementations§
impl Freeze for WhitespaceCleaner
impl RefUnwindSafe for WhitespaceCleaner
impl Send for WhitespaceCleaner
impl Sync for WhitespaceCleaner
impl Unpin for WhitespaceCleaner
impl UnsafeUnpin for WhitespaceCleaner
impl UnwindSafe for WhitespaceCleaner
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