Skip to content

Commit

Permalink
Percolate generic changes
Browse files Browse the repository at this point in the history
  • Loading branch information
phillord committed Jun 30, 2024
1 parent e8e2d45 commit 9b33556
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/io/owx/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::model::*;
use crate::vocab::Facet;
use crate::vocab::Namespace::*;
use crate::vocab::OWL2Datatype;
use crate::{ontology::set::SetOntology, vocab::OWL};
use crate::vocab::OWL;

use std::borrow::Cow;
use std::collections::BTreeSet;
Expand All @@ -30,10 +30,10 @@ where
reader: NsReader<R>,
}

pub fn read<R: BufRead>(
pub fn read<A: ForIRI, O: MutableOntology<A> + Default, R: BufRead>(
bufread: &mut R,
_config: ParserConfiguration,
) -> Result<(SetOntology<RcStr>, PrefixMapping), HornedError> {
) -> Result<(O, PrefixMapping), HornedError> {
let b = Build::new();
read_with_build(bufread, &b)
}
Expand Down
2 changes: 1 addition & 1 deletion src/io/owx/writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ mod test {
let r = read(bufread, ParserConfiguration::default());
assert!(r.is_ok(), "Expected ontology, got failure:{:?}", r.err());
let (o, m) = r.ok().unwrap();
(o.into(), m)
(o, m)
}

#[test]
Expand Down
18 changes: 1 addition & 17 deletions src/visitor/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -813,24 +813,8 @@ impl<A: ForIRI, V: VisitMut<A>> WalkMut<A, V> {

mod test {
use super::*;
use crate::io::owx::reader::read;
use crate::io::ParserConfiguration;
use crate::io::owx::reader::test::read_ok;
use crate::model::Build;
use crate::ontology::component_mapped::ComponentMappedOntology;
use curie::PrefixMapping;
use std::io::BufRead;

pub fn read_ok<R: BufRead>(
bufread: &mut R,
) -> (
ComponentMappedOntology<RcStr, RcAnnotatedComponent>,
PrefixMapping,
) {
let r = read(bufread, ParserConfiguration::default());
assert!(r.is_ok(), "Expected ontology, got failure:{:?}", r.err());
let (o, m) = r.ok().unwrap();
(o.into(), m)
}

struct LabeltoFred;
impl<A: ForIRI> VisitMut<A> for LabeltoFred {
Expand Down

0 comments on commit 9b33556

Please sign in to comment.