/
githubmirror
/
meilisearch
Обзор
Документация
Войти
/
githubmirror
/
meilisearch
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
crates/fuzzers/src/lib.rs
46 строк
1006 B
Clément Renault
Move crates under a sub folder to clean up the code
21 окт 2024, 09:18
Не верифицирован
21 окт 2024, 09:18
9c1e54a
Код
Авторство
О чём код?
use arbitrary::Arbitrary; use serde_json::{json, Value}; #[derive(Debug, Arbitrary)] pub enum Document { One, Two, Three, Four, Five, Six, } impl Document { pub fn to_d(&self) -> Value { match self { Document::One => json!({ "id": 0, "doggo": "bernese" }), Document::Two => json!({ "id": 0, "doggo": "golden" }), Document::Three => json!({ "id": 0, "catto": "jorts" }), Document::Four => json!({ "id": 1, "doggo": "bernese" }), Document::Five => json!({ "id": 1, "doggo": "golden" }), Document::Six => json!({ "id": 1, "catto": "jorts" }), } } } #[derive(Debug, Arbitrary)] pub enum DocId { Zero, One, } impl DocId { pub fn to_s(&self) -> String { match self { DocId::Zero => "0".to_string(), DocId::One => "1".to_string(), } } } #[derive(Debug, Arbitrary)] pub enum Operation { AddDoc(Document), DeleteDoc(DocId), }