1
0
mirror of https://gitlab.com/comunic/comunicapiv3 synced 2024-12-27 22:18:51 +00:00

Complete previous commit

This commit is contained in:
Pierre HUBERT 2020-06-25 10:21:27 +02:00
parent 96f3217db4
commit 63c792d497
2 changed files with 2 additions and 2 deletions

View File

@ -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());

View File

@ -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<PathBuf> {
pub fn prepare_file_creation(user_id: &UserID, folder: &str) -> ResultBoxError<PathBuf> {
let subfolder = match user_id.id() {
0 => Path::new(folder).to_path_buf(),
id => Path::new(folder).join(to_string(&id)?)