Makes Graph and Dataset implement Clone

pull/606/head
Tpt 1 year ago committed by Thomas Tanon
parent 3de3f9c4bc
commit 872111ab88
  1. 2
      lib/oxrdf/src/dataset.rs
  2. 2
      lib/oxrdf/src/graph.rs
  3. 4
      lib/oxrdf/src/interning.rs

@ -62,7 +62,7 @@ use std::hash::{Hash, Hasher};
/// assert_eq!(vec![TripleRef::new(ex, ex, ex)], results); /// assert_eq!(vec![TripleRef::new(ex, ex, ex)], results);
/// # Result::<_,Box<dyn std::error::Error>>::Ok(()) /// # Result::<_,Box<dyn std::error::Error>>::Ok(())
/// ``` /// ```
#[derive(Debug, Default)] #[derive(Debug, Default, Clone)]
pub struct Dataset { pub struct Dataset {
interner: Interner, interner: Interner,
gspo: BTreeSet<( gspo: BTreeSet<(

@ -48,7 +48,7 @@ use std::fmt;
/// assert_eq!(vec![triple], results); /// assert_eq!(vec![triple], results);
/// # Result::<_,Box<dyn std::error::Error>>::Ok(()) /// # Result::<_,Box<dyn std::error::Error>>::Ok(())
/// ``` /// ```
#[derive(Debug, Default)] #[derive(Debug, Default, Clone)]
pub struct Graph { pub struct Graph {
dataset: Dataset, dataset: Dataset,
} }

@ -4,7 +4,7 @@ use crate::*;
use std::collections::hash_map::{Entry, HashMap, RandomState}; use std::collections::hash_map::{Entry, HashMap, RandomState};
use std::hash::{BuildHasher, Hasher}; use std::hash::{BuildHasher, Hasher};
#[derive(Debug, Default)] #[derive(Debug, Default, Clone)]
pub struct Interner { pub struct Interner {
hasher: RandomState, hasher: RandomState,
string_for_hash: HashMap<u64, String, IdentityHasherBuilder>, string_for_hash: HashMap<u64, String, IdentityHasherBuilder>,
@ -503,7 +503,7 @@ impl InternedTriple {
} }
} }
#[derive(Default)] #[derive(Default, Clone)]
struct IdentityHasherBuilder; struct IdentityHasherBuilder;
impl BuildHasher for IdentityHasherBuilder { impl BuildHasher for IdentityHasherBuilder {

Loading…
Cancel
Save