Added missed 'Sized' constraint to traits
This commit is contained in:
parent
2bb3b7a9a9
commit
b45df143d2
@ -12,7 +12,7 @@ pub trait Keyword<C: Copy> {
|
|||||||
) -> Option<impl KeywordComparatorIterator<C> + use<'keyword, Self, C>>;
|
) -> Option<impl KeywordComparatorIterator<C> + use<'keyword, Self, C>>;
|
||||||
}
|
}
|
||||||
|
|
||||||
pub trait CollectedSubstring {
|
pub trait CollectedSubstring: Sized {
|
||||||
type C: Copy;
|
type C: Copy;
|
||||||
fn compareKeyword(&self, kw: impl Keyword<Self::C>) -> bool;
|
fn compareKeyword(&self, kw: impl Keyword<Self::C>) -> bool;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,7 +19,7 @@ pub trait StreamConverter_Substring<C: Copy, CS: CollectedSubstring<C = C>>:
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub trait StreamConverter<C: Copy, P: Pos, CS: CollectedSubstring<C = C>>:
|
pub trait StreamConverter<C: Copy, P: Pos, CS: CollectedSubstring<C = C>>:
|
||||||
StreamConverter_Char<C> + StreamConverter_Pos<P> + StreamConverter_Substring<C, CS>
|
Sized + StreamConverter_Char<C> + StreamConverter_Pos<P> + StreamConverter_Substring<C, CS>
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,7 +27,7 @@ impl<
|
|||||||
C: Copy,
|
C: Copy,
|
||||||
P: Pos,
|
P: Pos,
|
||||||
CS: CollectedSubstring<C = C>,
|
CS: CollectedSubstring<C = C>,
|
||||||
W: StreamConverter_Char<C> + StreamConverter_Pos<P> + StreamConverter_Substring<C, CS>,
|
W: Sized + StreamConverter_Char<C> + StreamConverter_Pos<P> + StreamConverter_Substring<C, CS>,
|
||||||
> StreamConverter<C, P, CS> for W
|
> StreamConverter<C, P, CS> for W
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
pub trait Pos {}
|
pub trait Pos: Sized {}
|
||||||
|
|
||||||
impl Pos for () {}
|
impl Pos for () {}
|
||||||
impl Pos for usize {}
|
impl Pos for usize {}
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
use crate::pos::Pos;
|
use crate::pos::Pos;
|
||||||
|
|
||||||
pub trait PosCounter<C: Copy> {
|
pub trait PosCounter<C: Copy>: Sized {
|
||||||
type P: Pos;
|
type P: Pos;
|
||||||
|
|
||||||
fn update(&mut self, c: C);
|
fn update(&mut self, c: C);
|
||||||
|
|
||||||
fn export(&self) -> Self::P;
|
fn export(&self) -> Self::P;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user