Skip to content

Commit

Permalink
Relax trait bounds
Browse files Browse the repository at this point in the history
Signed-off-by: Moritz Hoffmann <[email protected]>
  • Loading branch information
antiguru committed May 24, 2024
1 parent d3ffc2e commit ba726c5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface to permit a multitude of types to be presented to the same region. For
example, a region containing string-like objects and only promising access to
`&str` can accept anything that looks like a string, i.e., `String`, `&str` and
references to said types. A region's write-half should be implemented using the
[`CopyOnto`] trait.
[`Push`] trait.

Regions permit data access through opaque indexes, which the caller is responsible
for memorizing. An index grants access to the region-specific data representation,
Expand Down
2 changes: 1 addition & 1 deletion src/impls/slice.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ where

impl<'a, T, R, O> ReserveItems<&'a Vec<T>> for SliceRegion<R, O>
where
R: Region + ReserveItems<&'a T>,
for<'b> R: Region + ReserveItems<&'b T>,
O: OffsetContainer<R::Index>,
{
fn reserve_items<I>(&mut self, items: I)
Expand Down
6 changes: 3 additions & 3 deletions src/impls/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ where
}
}

impl<'a, R> ReserveItems<&'a &'a str> for StringRegion<R>
impl<'a, 'b: 'a, R> ReserveItems<&'a &'b str> for StringRegion<R>
where
for<'b> R: Region<ReadItem<'b> = &'b [u8]> + ReserveItems<&'b [u8]> + 'b,
for<'c> R: Region<ReadItem<'c> = &'c [u8]> + ReserveItems<&'c [u8]> + 'c,
{
#[inline]
fn reserve_items<I>(&mut self, items: I)
where
I: Iterator<Item = &'a &'a str> + Clone,
I: Iterator<Item = &'a &'b str> + Clone,
{
self.reserve_items(items.copied());
}
Expand Down

0 comments on commit ba726c5

Please sign in to comment.