diff --git a/src/data/http_request_handler.rs b/src/data/http_request_handler.rs index 59f8aad..d40247b 100644 --- a/src/data/http_request_handler.rs +++ b/src/data/http_request_handler.rs @@ -326,7 +326,7 @@ impl HttpRequestHandler { // Determine image destination - let target_user_data_folder = prepare_file_creation(self.user_id()?, folder)?; + let target_user_data_folder = prepare_file_creation(&self.user_id()?, folder)?; let target_file_path = generate_new_user_data_file_name(target_user_data_folder.as_path(), "png")?; let target_sys_path = user_data_path(target_file_path.as_path()); diff --git a/src/utils/user_data_utils.rs b/src/utils/user_data_utils.rs index ceda793..edbb7cc 100644 --- a/src/utils/user_data_utils.rs +++ b/src/utils/user_data_utils.rs @@ -27,7 +27,7 @@ pub fn user_data_path(uri: &Path) -> PathBuf { /// /// This function returns the relative folder path in user data directory where the file can be /// created -pub fn prepare_file_creation(user_id: UserID, folder: &str) -> ResultBoxError { +pub fn prepare_file_creation(user_id: &UserID, folder: &str) -> ResultBoxError { let subfolder = match user_id.id() { 0 => Path::new(folder).to_path_buf(), id => Path::new(folder).join(to_string(&id)?)