pub fn try_with_recovery<B, E>(
        self,
        f: impl FnOnce(&TempDir) -> Result<B, E>,
    ) -> Result<(TempDir, B), E> {
        match f(&self) {
            Ok(x) => Ok((self, x)),
            Err(e) => {
                self.recover();
                Err(e)
            }
        }
    }
/// Recover the tempdir if a closure returns Err.
Recover the tempdir if a closure returns Err.
Recover the tempdir if a closure returns Err .
pub fn try_with_recovery<B, E>(
        self,
        f: impl FnOnce(&TempDir) -> Result<B, E>,
    ) -> Result<(TempDir, B), E> {
        match f(&self) {
            Ok(x) => Ok((self, x)),
            Err(e) => {
                self.recover();
                Err(e)
            }
        }
    }
pub fn try_with_recovery < B , E > ( self , f : impl FnOnce ( & TempDir ) -> Result < B , E > , ) -> Result < ( TempDir , B ) , E > { match f ( & self ) { Ok ( x ) => Ok ( ( self , x ) ) , Err ( e ) => { self . recover ( ) ; Err ( e ) } } }
Recover the tempdir if a closure returns Err.
Recover the tempdir if a closure returns Err .
self
f
impl FnOnce(&TempDir) -> Result<B, E>
self
f
impl FnOnce(&TempDir) -> Result<B, E>