#![doc(html_logo_url = "https://github.com/onlivfe/vrc_rs/raw/main/logo.png")]
#![allow(unexpected_cfgs)]
#![cfg_attr(nightly, feature(doc_auto_cfg))]
#![deny(clippy::all)]
#![forbid(unsafe_code)]
#![deny(clippy::cargo)]
#![warn(missing_docs)]
#![deny(rustdoc::invalid_html_tags)]
#![warn(clippy::pedantic)]
#![warn(clippy::nursery)]
#![allow(clippy::tabs_in_doc_comments)]
#![allow(clippy::multiple_crate_versions)]
#![allow(clippy::redundant_pub_crate)]
use serde::{Deserialize, Deserializer};
pub mod id;
pub mod model;
pub mod query;
pub const API_BASE_URI: &str = "https://vrchat.com/api/1";
pub const API_KEY: &str = "JlE5Jldo5Jibnk5O5hTx6XVqsJu4WJ26";
time::serde::format_description!(date_format, Date, "[year]-[month]-[day]");
#[cfg(feature = "api_client")]
pub mod api_client;
fn deserialize_optional_date<'de, D>(
deserializer: D,
) -> Result<Option<time::OffsetDateTime>, D::Error>
where
D: Deserializer<'de>,
{
use time::serde::rfc3339;
#[derive(Deserialize)]
#[serde(untagged)]
enum MaybeNone {
#[serde(with = "rfc3339::option")]
Value(Option<time::OffsetDateTime>),
NoneString(String),
}
let value: MaybeNone = Deserialize::deserialize(deserializer)?;
match value {
MaybeNone::Value(value) => Ok(value),
MaybeNone::NoneString(string) => {
if string == "none" {
Ok(None)
} else {
Err(serde::de::Error::custom("Unexpected string"))
}
}
}
}