irmin/
util.rs

1use crate::internal::*;
2
3pub(crate) fn cstring(s: impl AsRef<str>) -> String {
4    let mut s = s.as_ref().to_string();
5    s.push('\0');
6    s
7}
8
9#[derive(Clone)]
10pub struct UntypedRepo<'a> {
11    pub(crate) ptr: *mut IrminRepo,
12    pub(crate) _t: std::marker::PhantomData<&'a ()>,
13}
14
15impl<'a> UntypedRepo<'a> {
16    pub fn new<T: Contents>(repo: &'a Repo<T>) -> UntypedRepo<'a> {
17        UntypedRepo {
18            ptr: repo.ptr,
19            _t: std::marker::PhantomData,
20        }
21    }
22}