Skip to content

Commit

Permalink
Remove unused Writable::create() function
Browse files Browse the repository at this point in the history
The functionality isn't used anymore, since the add_file() function will call create_dir_all() if not all folders are found.
  • Loading branch information
hasenbanck committed Dec 16, 2024
1 parent 90fae2d commit ed0ad29
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 7 deletions.
5 changes: 0 additions & 5 deletions korangar/src/loaders/archive/folder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,6 @@ impl Archive for FolderArchive {
}

impl Writable for FolderArchive {
fn create(&mut self) {
fs::create_dir_all(&self.folder_path)
.unwrap_or_else(|_| panic!("error creating folder {} for FolderArchive", self.folder_path.display()));
}

fn add_file(&mut self, file_path: &str, file_data: Vec<u8>) {
let normalized_asset_path = Self::os_specific_path(file_path);
let full_path = self.folder_path.join(normalized_asset_path);
Expand Down
2 changes: 0 additions & 2 deletions korangar/src/loaders/archive/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ pub enum ArchiveType {

/// A common trait to all writable archives.
pub trait Writable {
fn create(&mut self) {}

fn add_file(&mut self, path: &str, asset: Vec<u8>);

fn save(&self) {}
Expand Down

0 comments on commit ed0ad29

Please sign in to comment.