hardcode the midfix variable

This commit is contained in:
blek 2023-12-11 02:42:52 +10:00
parent e84ddee2a4
commit ea15e25fe2
Signed by: blek
GPG Key ID: 14546221E3595D0C
1 changed files with 2 additions and 8 deletions

View File

@ -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()
)
)