Fix files naming #24
|
@ -102,10 +102,6 @@ impl FileManager {
|
|||
|
||||
pub fn save(self: &Self, file: &File, kind: LookupKind) -> Result<(), Box<dyn Error>> {
|
||||
let file = file.clone();
|
||||
let midfix = match kind {
|
||||
LookupKind::ByName => "-name-",
|
||||
LookupKind::ByHash => "-hash-"
|
||||
};
|
||||
|
||||
match kind {
|
||||
LookupKind::ByName => {
|
||||
|
@ -114,9 +110,8 @@ impl FileManager {
|
|||
return Ok(self.save_int(
|
||||
&file,
|
||||
format!(
|
||||
"{}{}{}",
|
||||
"{}-name-{}",
|
||||
|
||||
self.env.redis.prefix,
|
||||
midfix,
|
||||
name
|
||||
)
|
||||
)?)
|
||||
|
@ -130,9 +125,8 @@ impl FileManager {
|
|||
self.save_int(
|
||||
&file,
|
||||
format!(
|
||||
"{}{}{}",
|
||||
"{}-hash-{}",
|
||||
self.env.redis.prefix,
|
||||
midfix,
|
||||
file.hash()
|
||||
)
|
||||
)
|
||||
|
|
Loading…
Reference in New Issue
breaks dry? see line 130 as well. not quite sure if thats a bad thing