Created
November 17, 2020 04:05
-
-
Save richo/c044de1ec9a9cb2d4ee84eddb463e4fd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impl PathWithTransform for RemotePathDescriptor { | |
type Output = RemotePathDescriptor; | |
fn with_modification<T: AsTransform>(&self, detail: &T) -> RemotePathDescriptor { | |
use RemotePathDescriptor::*; | |
let tweak = detail.as_transform().tweak_name(); | |
match self { | |
dt @ DateTime { .. } => dt.clone(), | |
dn @ DateName { .. } => { | |
let new = dn.clone(); | |
new.name.push_str(tweak); | |
new | |
}, | |
sp @ SpecifiedPath { .. } => { | |
let new = sp.clone(); | |
new.name.push_str(tweak); | |
new | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment