Implement From<CorpusId> for usize (#1152)

This commit is contained in:
Dominik Maier 2023-03-16 16:12:00 +01:00 committed by GitHub
parent a351e7a509
commit b9970cbdac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -54,6 +54,13 @@ impl From<u64> for CorpusId {
} }
} }
impl From<CorpusId> for usize {
/// Not that the `CorpusId` is not necessarily stable in the corpus (if we remove [`Testcase`]s, for example).
fn from(id: CorpusId) -> Self {
id.0
}
}
/// Utility macro to call `Corpus::random_id` /// Utility macro to call `Corpus::random_id`
#[macro_export] #[macro_export]
macro_rules! random_corpus_id { macro_rules! random_corpus_id {