From ba726c516fe8b5b147154363a2a7cf9beaecb09f Mon Sep 17 00:00:00 2001 From: Moritz Hoffmann Date: Fri, 24 May 2024 11:47:10 -0400 Subject: [PATCH] Relax trait bounds Signed-off-by: Moritz Hoffmann --- README.md | 2 +- src/impls/slice.rs | 2 +- src/impls/string.rs | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index d65e161..dfbdefa 100644 --- a/README.md +++ b/README.md @@ -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, diff --git a/src/impls/slice.rs b/src/impls/slice.rs index 3afbce1..8dab8be 100644 --- a/src/impls/slice.rs +++ b/src/impls/slice.rs @@ -278,7 +278,7 @@ where impl<'a, T, R, O> ReserveItems<&'a Vec> for SliceRegion where - R: Region + ReserveItems<&'a T>, + for<'b> R: Region + ReserveItems<&'b T>, O: OffsetContainer, { fn reserve_items(&mut self, items: I) diff --git a/src/impls/string.rs b/src/impls/string.rs index 26c68a8..b6aabb1 100644 --- a/src/impls/string.rs +++ b/src/impls/string.rs @@ -152,14 +152,14 @@ where } } -impl<'a, R> ReserveItems<&'a &'a str> for StringRegion +impl<'a, 'b: 'a, R> ReserveItems<&'a &'b str> for StringRegion where - for<'b> R: Region = &'b [u8]> + ReserveItems<&'b [u8]> + 'b, + for<'c> R: Region = &'c [u8]> + ReserveItems<&'c [u8]> + 'c, { #[inline] fn reserve_items(&mut self, items: I) where - I: Iterator + Clone, + I: Iterator + Clone, { self.reserve_items(items.copied()); }