зеркало из https://github.com/mozilla/sccache.git
Fix compilation error when not using Azure support
This also fixes CI errors.
This commit is contained in:
Родитель
549cfd405b
Коммит
72755c6942
|
@ -460,6 +460,7 @@ pub trait DateTimeExt {
|
|||
fn to_rfc7231(&self) -> String;
|
||||
}
|
||||
|
||||
#[cfg(feature = "azure")]
|
||||
impl<Tz: chrono::TimeZone> DateTimeExt for chrono::DateTime<Tz>
|
||||
where
|
||||
Tz::Offset: core::fmt::Display,
|
||||
|
@ -560,8 +561,6 @@ pub fn daemonize() -> Result<()> {
|
|||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::OsStrExt;
|
||||
use crate::util::DateTimeExt;
|
||||
use chrono::{DateTime, NaiveDateTime, Utc};
|
||||
use std::ffi::{OsStr, OsString};
|
||||
|
||||
#[test]
|
||||
|
@ -591,8 +590,12 @@ mod tests {
|
|||
assert_eq!(a.split_prefix("b"), None);
|
||||
}
|
||||
|
||||
#[cfg(feature = "azure")]
|
||||
#[test]
|
||||
fn rfc7231_format() {
|
||||
use crate::util::DateTimeExt;
|
||||
use chrono::{DateTime, NaiveDateTime, Utc};
|
||||
|
||||
let time = DateTime::<Utc>::from_utc(NaiveDateTime::from_timestamp(0, 0), Utc);
|
||||
|
||||
assert_eq!(time.to_rfc7231(), "Thu, 01 Jan 1970 00:00:00 GMT");
|
||||
|
|
Загрузка…
Ссылка в новой задаче