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