Merge pull request #1717 from iced-rs/remove-clone-image-bytes
Remove `Clone` bound for `Bytes::new` in `image`
This commit is contained in:
commit
1b79df4433
1 changed files with 3 additions and 3 deletions
|
|
@ -28,7 +28,7 @@ impl Handle {
|
||||||
pub fn from_pixels(
|
pub fn from_pixels(
|
||||||
width: u32,
|
width: u32,
|
||||||
height: u32,
|
height: u32,
|
||||||
pixels: impl AsRef<[u8]> + Clone + Send + Sync + 'static,
|
pixels: impl AsRef<[u8]> + Send + Sync + 'static,
|
||||||
) -> Handle {
|
) -> Handle {
|
||||||
Self::from_data(Data::Rgba {
|
Self::from_data(Data::Rgba {
|
||||||
width,
|
width,
|
||||||
|
|
@ -44,7 +44,7 @@ impl Handle {
|
||||||
/// This is useful if you already have your image loaded in-memory, maybe
|
/// This is useful if you already have your image loaded in-memory, maybe
|
||||||
/// because you downloaded or generated it procedurally.
|
/// because you downloaded or generated it procedurally.
|
||||||
pub fn from_memory(
|
pub fn from_memory(
|
||||||
bytes: impl AsRef<[u8]> + Clone + Send + Sync + 'static,
|
bytes: impl AsRef<[u8]> + Send + Sync + 'static,
|
||||||
) -> Handle {
|
) -> Handle {
|
||||||
Self::from_data(Data::Bytes(Bytes::new(bytes)))
|
Self::from_data(Data::Bytes(Bytes::new(bytes)))
|
||||||
}
|
}
|
||||||
|
|
@ -93,7 +93,7 @@ pub struct Bytes(Arc<dyn AsRef<[u8]> + Send + Sync + 'static>);
|
||||||
|
|
||||||
impl Bytes {
|
impl Bytes {
|
||||||
/// Creates new [`Bytes`] around `data`.
|
/// Creates new [`Bytes`] around `data`.
|
||||||
pub fn new(data: impl AsRef<[u8]> + Clone + Send + Sync + 'static) -> Self {
|
pub fn new(data: impl AsRef<[u8]> + Send + Sync + 'static) -> Self {
|
||||||
Self(Arc::new(data))
|
Self(Arc::new(data))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue