pub const BASE_URL: &str = "https://api.modrinth.com/v2";
pub const USER_AGENT: &str = concat!(
"Lighty-Launcher/",
env!("CARGO_PKG_VERSION"),
" (https://github.com/Lighty-Launcher/LightyLauncherLib)"
);
pub const PROVIDER: &str = "modrinth";
pub fn url_encode(input: &str) -> String {
let mut out = String::with_capacity(input.len() + 8);
for byte in input.bytes() {
match byte {
b'A'..=b'Z' | b'a'..=b'z' | b'0'..=b'9' | b'-' | b'_' | b'.' | b'~' => {
out.push(byte as char);
}
_ => out.push_str(&format!("%{:02X}", byte)),
}
}
out
}