mirror of
https://github.com/YGGverse/titanit.git
synced 2026-04-01 09:35:32 +00:00
use titanite library for backend
This commit is contained in:
parent
a4518ba93d
commit
08c437920c
6 changed files with 89 additions and 147 deletions
|
|
@ -63,10 +63,13 @@ impl Item {
|
|||
// Actions
|
||||
|
||||
/// Take object processed, commit its changes
|
||||
pub fn commit(self) -> Result<()> {
|
||||
pub fn commit(self) -> Result<String> {
|
||||
match self.path.to_str() {
|
||||
Some(old) => match old.strip_suffix(TMP_SUFFIX) {
|
||||
Some(new) => Ok(rename(old, new)?),
|
||||
Some(new) => {
|
||||
rename(old, new)?;
|
||||
Ok(new.to_string())
|
||||
}
|
||||
None => bail!("Invalid TMP suffix"), // | panic
|
||||
},
|
||||
None => bail!("Invalid Item path"), // | panic
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue