Fix files naming #24

Merged
blek merged 3 commits from fix-naming into 0.2-dev 2023-12-11 00:56:44 +01:00
1 changed files with 2 additions and 8 deletions
Showing only changes of commit ea15e25fe2 - Show all commits

View File

@ -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-{}",
Outdated
Review

breaks dry? see line 130 as well. not quite sure if thats a bad thing

breaks dry? see line 130 as well. not quite sure if thats a bad thing
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()
) )
) )