Repo of no-std crates for my personal embedded projects

chore: Extra sntp conversion methods, close on all errors

+6
+6
sachy-sntp/src/lib.rs
··· 68 68 } 69 69 70 70 #[cfg(feature = "chrono")] 71 + pub fn try_to_utc(self) -> Result<chrono::DateTime<chrono::Utc>, SntpError> { 72 + self.try_into() 73 + } 74 + 75 + #[cfg(feature = "chrono")] 71 76 pub fn try_to_naive_datetime(self) -> Result<chrono::NaiveDateTime, SntpError> { 72 77 self.try_into() 73 78 } ··· 189 194 .await 190 195 .map_err(|e| { 191 196 error!("Failed to send: {}", e); 197 + self.close(); 192 198 SntpError::NetFailure 193 199 })??; 194 200