Moved Oid into document module.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
@@ -266,24 +266,6 @@ impl Operation {
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Clone, Debug)]
|
||||
enum QueryType {
|
||||
Query(Query),
|
||||
Oids(HashSet<Oid>),
|
||||
}
|
||||
|
||||
impl From<Query> for QueryType {
|
||||
fn from(value: Query) -> Self {
|
||||
QueryType::Query(value)
|
||||
}
|
||||
}
|
||||
|
||||
impl From<HashSet<Oid>> for QueryType {
|
||||
fn from(value: HashSet<Oid>) -> Self {
|
||||
QueryType::Oids(value)
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Clone, Debug)]
|
||||
@@ -490,32 +472,3 @@ impl Update {
|
||||
&mut self.values
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
|
||||
pub struct Oid {
|
||||
oid: Uuid,
|
||||
}
|
||||
|
||||
impl Oid {
|
||||
pub fn new() -> Self {
|
||||
Self {
|
||||
oid: Uuid::new_v4(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod oids {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn are_oids_random() {
|
||||
let count = 10;
|
||||
let mut holder: Vec<Oid> = Vec::new();
|
||||
while holder.len() < count {
|
||||
let result = Oid::new();
|
||||
assert!(!holder.contains(&result));
|
||||
holder.push(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user