Skip to content

Commit 92dba66

Browse files
committed
Make Context clonable
1 parent c72c4a8 commit 92dba66

File tree

4 files changed

+4
-0
lines changed

4 files changed

+4
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
- Update to `objc2` 0.6.0.
44
- Bump MSRV to Rust 1.71.
5+
- Make `Context` cloneable.
56

67
# 0.4.6
78

src/backend_dispatch.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ macro_rules! make_dispatch {
1717
($context_inner: ty, $surface_inner: ty, $buffer_inner: ty),
1818
)*
1919
) => {
20+
#[derive(Clone)]
2021
pub(crate) enum ContextDispatch<$dgen> {
2122
$(
2223
$(#[$attr])*

src/backends/web.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ use std::num::NonZeroU32;
1818
/// Display implementation for the web platform.
1919
///
2020
/// This just caches the document to prevent having to query it every time.
21+
#[derive(Clone)]
2122
pub struct WebDisplayImpl<D> {
2223
document: web_sys::Document,
2324
_display: D,

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ pub use backends::web::SurfaceExtWeb;
3030

3131
/// An instance of this struct contains the platform-specific data that must be managed in order to
3232
/// write to a window on that platform.
33+
#[derive(Clone)]
3334
pub struct Context<D> {
3435
/// The inner static dispatch object.
3536
context_impl: ContextDispatch<D>,

0 commit comments

Comments
 (0)