EEOOHGQQK43J36LQJDSS3UK56M54DXPYE4VB3K4A2XAYGOYDJAXAC
PP3E3TRE43L3ASY3APURWXWOZJRW6O2GFQ6QXYHEWXDNDAKGN34QC
SXEYMYF7P4RZMZ46WPL4IZUTSQ2ATBWYZX7QNVMS3SGOYXYOHAGQC
L4JXJHWXYNCL4QGJXNKKTOKKTAXKKXBJUUY7HFZGEUZ5A2V5H34QC
use std::path::PathBuf;
use std::path::{Path, PathBuf};
let target = std::fs::canonicalize(&target)?;
let r = Rename { source: &source, target: &target, }; std::fs::rename(r.source, r.target)?; let target = std::fs::canonicalize(r.target)?;
let r = Rename {
source: &source,
target: &target,
};
std::fs::rename(r.source, r.target)?;
let target = std::fs::canonicalize(r.target)?;
std::fs::rename(&source, &target)?;
std::mem::forget(r);
}struct Rename<'a> { source: &'a Path, target: &'a Path,
}
struct Rename<'a> {
source: &'a Path,
target: &'a Path,
impl<'a> Drop for Rename<'a> { fn drop(&mut self) { std::fs::rename(self.target, self.source).unwrap_or(()) }}
impl<'a> Drop for Rename<'a> {
fn drop(&mut self) {
std::fs::rename(self.target, self.source).unwrap_or(())