Files
Rocketmc/theseus/src/config.rs
Danielle 10610e157f Refactor Library
The launcher code was in a position ripe for sphagetti, so this rewrites it in a more robust way.
In addition to cleaner code, this provides the following changes:
- Removal of obsolete Mojang authentication
- The rebasing of some internal state into a Sled database
- Tweaks which make some internal mechanisms more robust (e.g. profiles which fail to load can be removed)
- Additional tooling integration such as direnv
- Distinct public API to avoid messing with too much internal code
- Unified error handling in the form of `theseus::Error` and `theseus::Result`
2022-06-27 15:53:25 -07:00

23 lines
551 B
Rust

//! Configuration structs
use once_cell::sync::Lazy;
use std::time;
pub static BINCODE_CONFIG: Lazy<bincode::config::Configuration> =
Lazy::new(|| {
bincode::config::standard()
.with_little_endian()
.with_no_limit()
});
pub static REQWEST_CLIENT: Lazy<reqwest::Client> = Lazy::new(|| {
reqwest::Client::builder()
.tcp_keepalive(Some(time::Duration::from_secs(10)))
.build()
.unwrap()
});
pub fn sled_config() -> sled::Config {
sled::Config::default().use_compression(true)
}