mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
mgr didn't need to be mutable
This commit is contained in:
parent
f7c26724f3
commit
ce241f9756
2 changed files with 2 additions and 2 deletions
|
@ -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())
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue