InliningDyn
unsized
This commit is contained in:
parent
8cf8680353
commit
f86c6edf9f
@ -88,8 +88,8 @@ impl<'a: 'c, 'c, Ctx: Context<'a>> InCtx<'a, Ctx> for &'c mut dyn DeCtx<'a, Ctx>
|
||||
}
|
||||
}
|
||||
|
||||
pub trait InliningDyn: Sized {
|
||||
fn idread_n(self, n: usize) -> Result<(Vec<u8>, Self), Vec<u8>>;
|
||||
pub trait InliningDyn {
|
||||
fn idread_n(self, n: usize) -> Result<(Vec<u8>, Box<Self>), Vec<u8>>;
|
||||
|
||||
fn idread_all(self) -> Vec<u8>;
|
||||
|
||||
@ -97,8 +97,9 @@ pub trait InliningDyn: Sized {
|
||||
}
|
||||
|
||||
impl<I: Inlining> InliningDyn for I {
|
||||
fn idread_n(self, n: usize) -> Result<(Vec<u8>, Self), Vec<u8>> {
|
||||
self.iread_n(n, |slice| Vec::from(slice), |slice| Vec::from(slice))
|
||||
fn idread_n(self, n: usize) -> Result<(Vec<u8>, Box<Self>), Vec<u8>> {
|
||||
let (vec, i) = self.iread_n(n, |slice| Vec::from(slice), |slice| Vec::from(slice))?;
|
||||
Ok((vec, i.into()))
|
||||
}
|
||||
|
||||
fn idread_all(self) -> Vec<u8> {
|
||||
|
Loading…
Reference in New Issue
Block a user