mgr didn't need to be mutable

This commit is contained in:
Damien Elmes 2020-02-08 20:56:58 +10:00
parent f7c26724f3
commit ce241f9756
2 changed files with 2 additions and 2 deletions

View file

@ -313,7 +313,7 @@ impl Backend {
}
fn add_file_to_media_folder(&mut self, input: pt::AddFileToMediaFolderIn) -> Result<String> {
let mut mgr = MediaManager::new(&self.media_folder, &self.media_db)?;
let mgr = MediaManager::new(&self.media_folder, &self.media_db)?;
Ok(mgr.add_file(&input.desired_name, &input.data)?.into())
}

View file

@ -38,7 +38,7 @@ impl MediaManager {
/// appended to the name.
///
/// Also notes the file in the media database.
pub fn add_file<'a>(&mut self, desired_name: &'a str, data: &[u8]) -> Result<Cow<'a, str>> {
pub fn add_file<'a>(&self, desired_name: &'a str, data: &[u8]) -> Result<Cow<'a, str>> {
let pre_add_folder_mtime = mtime_as_i64(&self.media_folder)?;
// add file to folder