fn is_speaker_over_heated(&self) -> Result<bool> {
        let last_run = run_time::from_file(&self.snd_card)?;
        let last_shutdown = shutdown_time::from_file()?;
        if last_shutdown < last_run {
            return Err(Error::InvalidShutDownTime);
        }

        let now = SystemTime::now()
            .duration_since(UNIX_EPOCH)
            .map_err(Error::SystemTimeError)?;

        let elapsed = now
            .checked_sub(last_shutdown)
            .ok_or(Error::InvalidShutDownTime)?;

        if elapsed < Self::SPEAKER_COOL_DOWN_TIME {
            return Ok(true);
        }
        Ok(false)
    }
// If (Current time - the latest CRAS shutdown time) < cool_down_time, we assume that
// the speakers may be overheated.
If (Current time - the latest CRAS shutdown time) < cool_down_time, we assume that
the speakers may be overheated.
If ( Current time - the latest CRAS shutdown time ) < cool_down_time we assume that the speakers may be overheated .
fn is_speaker_over_heated(&self) -> Result<bool> {
        let last_run = run_time::from_file(&self.snd_card)?;
        let last_shutdown = shutdown_time::from_file()?;
        if last_shutdown < last_run {
            return Err(Error::InvalidShutDownTime);
        }
        let now = SystemTime::now()
            .duration_since(UNIX_EPOCH)
            .map_err(Error::SystemTimeError)?;
        let elapsed = now
            .checked_sub(last_shutdown)
            .ok_or(Error::InvalidShutDownTime)?;
        if elapsed < Self::SPEAKER_COOL_DOWN_TIME {
            return Ok(true);
        }
        Ok(false)
    }
fn is_speaker_over_heated ( & self ) -> Result < bool > { let last_run = run_time :: from_file ( & self . snd_card ) ? ; let last_shutdown = shutdown_time :: from_file ( ) ? ; if last_shutdown < last_run { return Err ( Error :: InvalidShutDownTime ) ; } let now = SystemTime :: now ( ) . duration_since ( UNIX_EPOCH ) . map_err ( Error :: SystemTimeError ) ? ; let elapsed = now . checked_sub ( last_shutdown ) . ok_or ( Error :: InvalidShutDownTime ) ? ; if elapsed < Self :: SPEAKER_COOL_DOWN_TIME { return Ok ( true ) ; } Ok ( false ) }
If (Current time - the latest CRAS shutdown time) < cool_down_time, we assume that
the speakers may be overheated.
If ( Current time - the latest CRAS shutdown time ) < cool_down_time we assume that the speakers may be overheated .
&self
&self