Skip to main content

mlb_api/
lib.rs

1#![warn(clippy::pedantic, clippy::nursery, clippy::complexity, clippy::cargo, clippy::perf, clippy::style)]
2#![allow(clippy::multiple_crate_versions, clippy::ignore_without_reason)]
3
4pub use requests::*;
5
6pub mod hydrations;
7pub mod request;
8pub mod types;
9pub mod cache;
10mod requests;
11
12#[cfg(test)]
13pub const TEST_YEAR: u32 = 2025;
14
15#[cfg(feature = "reqwest")]
16pub(crate) type RwLock<T> = tokio::sync::RwLock<T>;
17
18#[cfg(feature = "ureq")]
19pub(crate) type RwLock<T> = parking_lot::RwLock<T>;
20
21#[cfg(feature = "reqwest")]
22pub(crate) const fn rwlock_const_new<T>(t: T) -> RwLock<T> {
23    RwLock::const_new(t)
24}
25
26#[cfg(feature = "ureq")]
27pub(crate) const fn rwlock_const_new<T>(t: T) -> RwLock<T> {
28    parking_lot::const_rwlock(t)
29}