Clippy code cleanup
This commit is contained in:
@@ -24,8 +24,7 @@ pub async fn send_data(id: String) {
|
||||
fn compress(data: Vec<u8>) -> Vec<u8> {
|
||||
let mut encoder = Encoder::new(Vec::new(), DEFAULT_COMPRESSION_LEVEL).unwrap();
|
||||
io::copy(&mut &data[..], &mut encoder).unwrap();
|
||||
let compressed = encoder.finish().unwrap();
|
||||
compressed
|
||||
encoder.finish().unwrap()
|
||||
}
|
||||
|
||||
pub async fn load_data(id: String, temp: bool) {
|
||||
@@ -84,7 +83,7 @@ pub async fn get_web_version(key: &str) -> Result<u32, reqwest::Error> {
|
||||
let id_url = format!("{API_URL}{key}/version");
|
||||
let client = reqwest::Client::new();
|
||||
let version = client.get(&id_url).send().await?.text().await?;
|
||||
return Ok(version.parse::<u32>().unwrap());
|
||||
Ok(version.parse::<u32>().unwrap())
|
||||
}
|
||||
|
||||
pub async fn get_local_version() -> u32 {
|
||||
@@ -95,7 +94,7 @@ pub async fn get_local_version() -> u32 {
|
||||
return data.parse::<u32>().unwrap();
|
||||
}
|
||||
|
||||
let mut file = OpenOptions::new().write(true).create(true).open(file).await.unwrap();
|
||||
let mut file = OpenOptions::new().write(true).create(true).truncate(true).open(file).await.unwrap();
|
||||
file.write_all("0".as_bytes()).await.unwrap();
|
||||
0
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user