summaryrefslogtreecommitdiffstats
path: root/src/launcher.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/launcher.rs')
-rw-r--r--src/launcher.rs35
1 files changed, 0 insertions, 35 deletions
diff --git a/src/launcher.rs b/src/launcher.rs
index 98a8020..e207281 100644
--- a/src/launcher.rs
+++ b/src/launcher.rs
@@ -195,41 +195,6 @@ impl LibraryRepository {
p.push(Self::get_artifact_filename(name, classifier)?);
Some(p)
}
-
- async fn should_redownload(&self, lib: &Library, classifier: Option<&str>) -> Result<bool, LibraryError> {
- let path = Self::get_artifact_path(lib.name.as_str(), classifier)
- .map_or_else(|| Err(LibraryError::InvalidName(lib.name.clone())), |p| Ok(p))?;
-
- let mut f = match File::open(path).await {
- Ok(f) => f,
- Err(e) => return match e.kind() {
- ErrorKind::NotFound => Ok(true),
- e => Err(LibraryError::IOError(e))
- }
- };
-
- let mut data = [0u8; 4096];
- let mut sha1 = Sha1::new();
-
- loop {
- let n = match f.read(&mut data).await {
- Ok(n) => n,
- Err(e) => return match e.kind() {
- ErrorKind::Interrupted => continue,
- kind => Err(LibraryError::IOError(kind))
- }
- };
-
- if n == 0 {
- break; // we reached the end of the file
- }
-
- sha1.update(&data[..n]);
- }
-
-
- todo!()
- }
}
impl SystemInfo {