diff options
| author | A Farzat <a@farzat.xyz> | 2026-02-14 16:30:56 +0300 |
|---|---|---|
| committer | A Farzat <a@farzat.xyz> | 2026-02-14 16:30:56 +0300 |
| commit | ca356049faf28ab48b73d04d80d4d11236d3abc6 (patch) | |
| tree | 53651b39470ab50ec48b9a996947f30432b7cedb /src/epub.rs | |
| parent | 3b8e89a25ad712e14771dcbd35ec021d1da99ad9 (diff) | |
| download | safaribooks-rs-ca356049faf28ab48b73d04d80d4d11236d3abc6.tar.gz safaribooks-rs-ca356049faf28ab48b73d04d80d4d11236d3abc6.zip | |
Group skeleton initialization into one function
Diffstat (limited to 'src/epub.rs')
| -rw-r--r-- | src/epub.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/epub.rs b/src/epub.rs index 90aeafb..63dfc4b 100644 --- a/src/epub.rs +++ b/src/epub.rs @@ -32,6 +32,14 @@ impl EpubSkeleton { } } + /// Initialize EpubSkeleton by creating directories and required files. + pub fn initialize(&self) -> Result<()> { + self.create_dirs()?; + self.write_mimetype()?; + self.write_container_xml()?; + Ok(()) + } + /// Create the directories defined in the struct. pub fn create_dirs(&self) -> Result<()> { fs::create_dir_all(&self.oebps) |
