File: fix-test-feature.patch

package info (click to toggle)
rust-interim 0.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 204 kB
  • sloc: makefile: 2
file content (30 lines) | stat: -rw-r--r-- 1,002 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -174,5 +174,5 @@
     use crate::{parse_duration, DateError, Dialect, Interval};
 
-    #[cfg(feature = "chrono")]
+    #[cfg(all(feature = "chrono", feature = "std"))]
     #[track_caller]
     fn format_chrono(d: &crate::types::DateTimeSpec, dialect: Dialect) -> String {
@@ -190,5 +190,5 @@
     }
 
-    #[cfg(feature = "time")]
+    #[cfg(all(feature = "time", feature = "std"))]
     #[track_caller]
     fn format_time(d: &crate::types::DateTimeSpec, dialect: Dialect) -> String {
@@ -222,5 +222,5 @@
                 Ok(date) => date,
             };
-            #[cfg(feature = "chrono")]
+            #[cfg(all(feature = "chrono", feature = "std"))]
             {
                 let output = format_chrono(&_date, dialect);
@@ -230,5 +230,5 @@
                 }
             }
-            #[cfg(feature = "time")]
+            #[cfg(all(feature = "time", feature = "std"))]
             {
                 let output = format_time(&_date, dialect);