tweak: use path.with_added_extension
This commit is contained in:
parent
8fa5251f62
commit
77ecc2034c
2 changed files with 2 additions and 2 deletions
|
|
@ -235,7 +235,7 @@ impl Theme {
|
||||||
#[cold]
|
#[cold]
|
||||||
fn backup_non_cosmic_css(path: &Path, cosmic_css: &Path) -> io::Result<()> {
|
fn backup_non_cosmic_css(path: &Path, cosmic_css: &Path) -> io::Result<()> {
|
||||||
if !Self::is_cosmic_css(path, cosmic_css)?.unwrap_or(true) {
|
if !Self::is_cosmic_css(path, cosmic_css)?.unwrap_or(true) {
|
||||||
let backup_path = path.with_extension("css.bak");
|
let backup_path = path.with_added_extension("bak");
|
||||||
fs::rename(path, &backup_path)?;
|
fs::rename(path, &backup_path)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
|
|
@ -283,7 +283,7 @@ contrast=4
|
||||||
#[cold]
|
#[cold]
|
||||||
fn backup_non_cosmic_kdeglobals(path: &Path) -> io::Result<()> {
|
fn backup_non_cosmic_kdeglobals(path: &Path) -> io::Result<()> {
|
||||||
if !Self::is_cosmic_kdeglobals(path)?.unwrap_or(true) {
|
if !Self::is_cosmic_kdeglobals(path)?.unwrap_or(true) {
|
||||||
let backup_path = path.with_extension("bak");
|
let backup_path = path.with_added_extension("bak");
|
||||||
fs::rename(path, &backup_path)?;
|
fs::rename(path, &backup_path)?;
|
||||||
}
|
}
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue