Skip to content

InMemoryOnDiskCorpus::with_meta_format_and_prefix does not actually add a prefix to files #3404

@EliaGeretto

Description

@EliaGeretto

It looks like the prefix field of InMemoryOnDiskCorpus can be set using with_meta_format_and_prefix, but it is actually never used to compose the name of the corpus files as the documentation states. The same holds for OnDiskCorpus::with_prefix, which offloads that functionality to this struct.

/// A corpus able to store [`Testcase`]s to disk, while also keeping all of them in memory.
///
/// Metadata is written to a `.<filename>.metadata` file in the same folder by default.
#[derive(Default, Serialize, Deserialize, Clone, Debug)]
pub struct InMemoryOnDiskCorpus<I> {
inner: InMemoryCorpus<I>,
dir_path: PathBuf,
meta_format: Option<OnDiskMetadataFormat>,
prefix: Option<String>,
locking: bool,
}

It looks like the prefix field was added as part of #981 but never completely implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions