From 9ba744a55a8bf8ca7c9e670f127f3defa3987a41 Mon Sep 17 00:00:00 2001 From: wznmickey Date: Wed, 15 Jan 2025 17:07:39 -0500 Subject: [PATCH] code quality --- src/course.rs | 4 ++-- src/download.rs | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/course.rs b/src/course.rs index 1d17a38..a00a830 100644 --- a/src/course.rs +++ b/src/course.rs @@ -130,7 +130,7 @@ impl GetFromJson>, PathBuf> for CourseFile { Some(CourseFile { id: x["id"].as_i64()?, my_parent_path: { - path.join(f.borrow().course.borrow().name.to_string()) + path.join(&f.borrow().course.borrow().name) .join(&f.borrow().fullname) }, display_name: temp, @@ -168,7 +168,7 @@ impl GetFromJson>, PathBuf> for CourseFile { Some(CourseFile { id: x["id"].as_i64()?, my_parent_path: { - path.join(f.borrow().course.borrow().name.to_string()) + path.join(&f.borrow().course.borrow().name) .join(&f.borrow().name) }, display_name: temp, diff --git a/src/download.rs b/src/download.rs index 58a1503..6338d47 100644 --- a/src/download.rs +++ b/src/download.rs @@ -193,7 +193,8 @@ impl RemoteData { path: PathBuf, ) -> Vec>> { let mut ans = Vec::new(); - for i in assignment.borrow().filelink.clone() { + let filelinks = assignment.borrow().filelink.clone(); + for i in filelinks { let url = i + "?"; // It is necessary to add a ?. Not sure why. let mut tempans = self .get_remote_json_list::>, PathBuf, CourseFile>(