'manually' implemented default
@@ -6,12 +6,11 @@ use serde::Serialize;
/// Indicates whether the user agent should send or receive user credentials
/// (cookies, basic http auth, etc.) from the other domain in the case of
/// cross-origin requests.
-#[derive(Default, Serialize)]
+#[derive(Serialize)]
#[serde(rename_all = "kebab-case")]
pub enum Credentials {
/// Send user credentials if the URL is on the same origin as the calling
/// script. This is the default value.
- #[default]
SameOrigin,
/// Always send user credentials, even for cross-origin calls.
Include,
@@ -19,6 +18,12 @@ pub enum Credentials {
Omit,
}
+impl Default for Credentials {
+ fn default() -> Self {
+ Credentials::SameOrigin
+ }
+}
+
/// A builder for constructing a GraphiQL (v2) HTML page.
///
/// # Example
