Fixing Empty MultipartInput Names Part 2 (#2751)

* fixing empty multipart name

* fixing clippy
This commit is contained in:
Valentin Huber 2024-12-06 21:22:05 +01:00 committed by GitHub
parent e602d26e5e
commit c2a9018631
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -154,7 +154,9 @@ where
I: Input,
{
fn generate_name(&self, id: Option<CorpusId>) -> String {
if self.names().len() > 0 {
if self.names().is_empty() {
"empty_multipart_input".to_string() // empty strings cause issues with OnDiskCorpus
} else {
self.names
.iter()
.cloned()
@ -162,8 +164,6 @@ where
.map(|(name, generated)| format!("{name}-{generated}"))
.collect::<Vec<_>>()
.join(",")
} else {
"empty_multipart".to_string() // empty strings cause issues with OnDiskCorpus
}
}
}