Skip to content

Commit

Permalink
Merge pull request iced-rs#1717 from iced-rs/remove-clone-image-bytes
Browse files Browse the repository at this point in the history
Remove `Clone` bound for `Bytes::new` in `image`
  • Loading branch information
hecrj authored Feb 18, 2023
2 parents f0decca + bf061a0 commit 1b79df4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions native/src/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ impl Handle {
pub fn from_pixels(
width: u32,
height: u32,
pixels: impl AsRef<[u8]> + Clone + Send + Sync + 'static,
pixels: impl AsRef<[u8]> + Send + Sync + 'static,
) -> Handle {
Self::from_data(Data::Rgba {
width,
Expand All @@ -44,7 +44,7 @@ impl Handle {
/// This is useful if you already have your image loaded in-memory, maybe
/// because you downloaded or generated it procedurally.
pub fn from_memory(
bytes: impl AsRef<[u8]> + Clone + Send + Sync + 'static,
bytes: impl AsRef<[u8]> + Send + Sync + 'static,
) -> Handle {
Self::from_data(Data::Bytes(Bytes::new(bytes)))
}
Expand Down Expand Up @@ -93,7 +93,7 @@ pub struct Bytes(Arc<dyn AsRef<[u8]> + Send + Sync + 'static>);

impl Bytes {
/// 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))
}
}
Expand Down

0 comments on commit 1b79df4

Please sign in to comment.