From 9b335563db9f432d9331e9a498b0df12e0ba1590 Mon Sep 17 00:00:00 2001 From: Phillip Lord Date: Sun, 30 Jun 2024 18:09:44 +0100 Subject: [PATCH] Percolate generic changes --- src/io/owx/reader.rs | 6 +++--- src/io/owx/writer.rs | 2 +- src/visitor/mutable.rs | 18 +----------------- 3 files changed, 5 insertions(+), 21 deletions(-) diff --git a/src/io/owx/reader.rs b/src/io/owx/reader.rs index 1295033..d8846a3 100644 --- a/src/io/owx/reader.rs +++ b/src/io/owx/reader.rs @@ -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; @@ -30,10 +30,10 @@ where reader: NsReader, } -pub fn read( +pub fn read + Default, R: BufRead>( bufread: &mut R, _config: ParserConfiguration, -) -> Result<(SetOntology, PrefixMapping), HornedError> { +) -> Result<(O, PrefixMapping), HornedError> { let b = Build::new(); read_with_build(bufread, &b) } diff --git a/src/io/owx/writer.rs b/src/io/owx/writer.rs index 879573e..9c20787 100644 --- a/src/io/owx/writer.rs +++ b/src/io/owx/writer.rs @@ -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] diff --git a/src/visitor/mutable.rs b/src/visitor/mutable.rs index 03a99df..76c5c11 100644 --- a/src/visitor/mutable.rs +++ b/src/visitor/mutable.rs @@ -813,24 +813,8 @@ impl> WalkMut { 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( - bufread: &mut R, - ) -> ( - ComponentMappedOntology, - 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 VisitMut for LabeltoFred {