diff --git a/src/subtype.rs b/src/subtype.rs index 8f398b1..8c46752 100644 --- a/src/subtype.rs +++ b/src/subtype.rs @@ -19,20 +19,20 @@ impl TypeTerm { None } - pub fn is_syntactic_subtype_of(&self, expected_type: &TypeTerm) -> Result> { + pub fn is_syntactic_subtype_of(&self, expected_type: &TypeTerm) -> Result { if let Some((first_match, provided_type)) = self.is_semantic_subtype_of( expected_type ) { let provided_lnf = provided_type.get_lnf_vec(); let expected_lnf = expected_type.clone().get_lnf_vec(); for i in 0 .. usize::min( provided_lnf.len(), expected_lnf.len() ) { if provided_lnf[i] != expected_lnf[i] { - return Err(Some((first_match, first_match+i))) + return Err((first_match, first_match+i)) } } Ok(first_match) } else { - Err(None) + Err((0,0)) } } @@ -43,7 +43,7 @@ impl TypeTerm { t.is_semantic_subtype_of(self) } - pub fn is_syntactic_supertype_of(&self, t: &TypeTerm) -> Result> { + pub fn is_syntactic_supertype_of(&self, t: &TypeTerm) -> Result { t.is_syntactic_subtype_of(self) } } diff --git a/src/test/subtype.rs b/src/test/subtype.rs index 54ad397..08cc5c7 100644 --- a/src/test/subtype.rs +++ b/src/test/subtype.rs @@ -62,7 +62,7 @@ fn test_syntactic_subtype() { .is_syntactic_subtype_of( &dict.parse("C~G").expect("parse errror") ), - Err(Some((2,3))) + Err((2,3)) ); assert_eq!( @@ -70,7 +70,7 @@ fn test_syntactic_subtype() { .is_syntactic_subtype_of( &dict.parse("G~F~K").expect("parse errror") ), - Err(None) + Err((0,0)) ); assert_eq!(