fn check_and_lock(&mut self) -> bool {
        let mut did_reopen = false;
        loop {
            if let Some(ref mut file) = self.file {
                if file.lock_exclusive().is_ok() {
                    if let Ok(meta) = fs::metadata(&self.name) {
                        if meta.dev() == self.dev && meta.ino() == self.ino {
                            break;
                        }
                    }
                }
            }
            let _ = self.reopen(true);
            did_reopen = true;
        }
        did_reopen
    }
// lock file, then check to see if it has changed. if it has,
// reopen file, and keep trying until it is stable.
lock file, then check to see if it has changed. if it has,
reopen file, and keep trying until it is stable.
lock file then check to see if it has changed . if it has reopen file and keep trying until it is stable .
fn check_and_lock(&mut self) -> bool {
        let mut did_reopen = false;
        loop {
            if let Some(ref mut file) = self.file {
                if file.lock_exclusive().is_ok() {
                    if let Ok(meta) = fs::metadata(&self.name) {
                        if meta.dev() == self.dev && meta.ino() == self.ino {
                            break;
                        }
                    }
                }
            }
            let _ = self.reopen(true);
            did_reopen = true;
        }
        did_reopen
    }
fn check_and_lock ( & mut self ) -> bool { let mut did_reopen = false ; loop { if let Some ( ref mut file ) = self . file { if file . lock_exclusive ( ) . is_ok ( ) { if let Ok ( meta ) = fs :: metadata ( & self . name ) { if meta . dev ( ) == self . dev && meta . ino ( ) == self . ino { break ; } } } } let _ = self . reopen ( true ) ; did_reopen = true ; } did_reopen }
lock file, then check to see if it has changed.
lock file then check to see if it has changed .
&mut self