summaryrefslogtreecommitdiffstats
path: root/src/launcher
diff options
context:
space:
mode:
Diffstat (limited to 'src/launcher')
-rw-r--r--src/launcher/assets.rs2
-rw-r--r--src/launcher/extract.rs2
-rw-r--r--src/launcher/jre.rs5
-rw-r--r--src/launcher/jre/download.rs7
-rw-r--r--src/launcher/runner.rs1
-rw-r--r--src/launcher/settings.rs1
6 files changed, 6 insertions, 12 deletions
diff --git a/src/launcher/assets.rs b/src/launcher/assets.rs
index cd75d0d..dacd01d 100644
--- a/src/launcher/assets.rs
+++ b/src/launcher/assets.rs
@@ -10,7 +10,6 @@ use reqwest::Client;
use sha1_smol::Sha1;
use tokio::{fs, io};
use tokio::fs::File;
-use tokio_stream::StreamExt;
use crate::assets::{Asset, AssetIndex};
use crate::launcher::download::{MultiDownloader, VerifiedDownload};
use crate::util;
@@ -307,6 +306,7 @@ impl AssetRepository {
}
}
+#[cfg(test)]
mod tests {
use super::*;
diff --git a/src/launcher/extract.rs b/src/launcher/extract.rs
index 0a08175..8c5f2b8 100644
--- a/src/launcher/extract.rs
+++ b/src/launcher/extract.rs
@@ -3,7 +3,7 @@ use std::fmt::{Display, Formatter};
use std::{fs, io, os};
use std::fs::File;
use std::io::{BufReader, Error as IOError, Read};
-use std::path::{Component, Path, PathBuf};
+use std::path::{Path, PathBuf};
use log::{debug, trace};
use zip::result::ZipError;
use zip::ZipArchive;
diff --git a/src/launcher/jre.rs b/src/launcher/jre.rs
index a3cbb27..0b92c20 100644
--- a/src/launcher/jre.rs
+++ b/src/launcher/jre.rs
@@ -1,4 +1,3 @@
-use std::collections::HashSet;
use std::error::Error;
use std::fmt::{Debug, Display, Formatter};
use std::path::{Component, Path, PathBuf};
@@ -7,8 +6,6 @@ use futures::{stream, StreamExt, TryStreamExt};
use log::{debug, info, warn};
use reqwest::Client;
use tokio::{fs, io, io::ErrorKind};
-use tokio::fs::File;
-use tokio::io::AsyncWriteExt;
mod arch;
mod manifest;
@@ -21,7 +18,7 @@ use crate::launcher::download::MultiDownloader;
use crate::launcher::jre::download::{LzmaDownloadError, LzmaDownloadJob};
use crate::launcher::jre::manifest::JavaRuntimeFile;
use crate::util;
-use crate::util::{EnsureFileError, FileVerifyError, IntegrityError};
+use crate::util::{EnsureFileError, IntegrityError};
use crate::version::DownloadInfo;
use super::constants;
diff --git a/src/launcher/jre/download.rs b/src/launcher/jre/download.rs
index c24b82f..ddf1ff6 100644
--- a/src/launcher/jre/download.rs
+++ b/src/launcher/jre/download.rs
@@ -1,14 +1,11 @@
use std::error::Error;
use std::fmt::{Debug, Display, Formatter};
-use std::fs::Permissions;
use std::io::Write;
-use std::ops::AddAssign;
-use std::path::{Path, PathBuf};
+use std::path::{PathBuf};
use log::debug;
use lzma_rs::decompress;
-use reqwest::{Client, IntoUrl, RequestBuilder};
+use reqwest::{Client, RequestBuilder};
use sha1_smol::{Digest, Sha1};
-use tokio::fs;
use tokio::io::AsyncWriteExt;
use tokio::fs::File;
use crate::launcher::download::Download;
diff --git a/src/launcher/runner.rs b/src/launcher/runner.rs
index a58602e..f7fd025 100644
--- a/src/launcher/runner.rs
+++ b/src/launcher/runner.rs
@@ -198,6 +198,7 @@ fn search_java_sync(base: impl AsRef<Path>, legacy: bool) -> Result<Option<PathB
Ok(None) // not found (sadface)
}
+//noinspection RsConstantConditionIf
pub async fn find_java(base: impl AsRef<Path>, legacy: bool) -> Result<Option<PathBuf>, io::Error> {
let meta = fs::metadata(&base).await?;
if meta.is_dir() { // do search
diff --git a/src/launcher/settings.rs b/src/launcher/settings.rs
index 5c8cb27..4dfc4ac 100644
--- a/src/launcher/settings.rs
+++ b/src/launcher/settings.rs
@@ -1,6 +1,5 @@
use std::collections::HashMap;
use std::error::Error;
-use std::ffi::{OsStr, OsString};
use std::fmt::{Display, Formatter};
use std::io::ErrorKind;
use std::path::{Path, PathBuf};