Skip to content

Commit d9e2158

Browse files
committed
rename traits to avoid ambiguity
as pointed out by @GordianDziwis, the name IriValid could be read as "valid IRI", implying that the trait Iri could yield invalid IRIs... see #6 (comment)
1 parent 7026161 commit d9e2158

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

statement_validation/src/_iri.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use r2c2_statement::Iri;
44
use regex::Regex;
55

66
/// Extension trait for [`Iri`] providing validation methods.
7-
pub trait IriValid<'a> {
7+
pub trait IriValidation<'a> {
88
/// Return a new [`Iri`] if the argument is a valid IRI, otherwise None.
99
#[allow(clippy::new_ret_no_self)]
1010
fn new(txt: impl Into<Cow<'a, str>>) -> Option<Iri<'a>>;
@@ -16,7 +16,7 @@ pub trait IriValid<'a> {
1616
fn debug_assert_is_valid(&self);
1717
}
1818

19-
impl<'a> IriValid<'a> for Iri<'a> {
19+
impl<'a> IriValidation<'a> for Iri<'a> {
2020
fn new(txt: impl Into<Cow<'a, str>>) -> Option<Self> {
2121
let inner = txt.into();
2222
IRI_REGEX

statement_validation/src/_language_tag.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use r2c2_statement::LangTag;
44
use regex::Regex;
55

66
/// Extension trait for [`LangTag`] providing validation methods.
7-
pub trait LangTagValid<'a> {
7+
pub trait LangTagValidation<'a> {
88
/// Return a new [`LangTag`] if the argument is a valid IRI, otherwise None.
99
#[allow(clippy::new_ret_no_self)]
1010
fn new(txt: impl Into<Cow<'a, str>>) -> Option<LangTag<'a>>;
@@ -16,7 +16,7 @@ pub trait LangTagValid<'a> {
1616
fn debug_assert_is_valid(&self);
1717
}
1818

19-
impl<'a> LangTagValid<'a> for LangTag<'a> {
19+
impl<'a> LangTagValidation<'a> for LangTag<'a> {
2020
fn new(txt: impl Into<Cow<'a, str>>) -> Option<Self> {
2121
let inner = txt.into();
2222
TAG_REGEX

0 commit comments

Comments
 (0)