Skip to content

Commit 88133d7

Browse files
committed
Merge branch 'dispatch_clone_dbg' into tmp
2 parents da8881d + 665774c commit 88133d7

File tree

6 files changed

+22
-0
lines changed

6 files changed

+22
-0
lines changed

gdnative-core/src/core_types/dictionary.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,12 @@ where
606606
}
607607
}
608608

609+
impl Clone for Dictionary {
610+
fn clone(&self) -> Self {
611+
self.new_ref()
612+
}
613+
}
614+
609615
godot_test!(test_dictionary {
610616
use std::collections::HashSet;
611617

gdnative-core/src/core_types/node_path.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,10 @@ impl fmt::Debug for NodePath {
176176
write!(f, "NodePath({})", self.to_string())
177177
}
178178
}
179+
180+
impl Clone for NodePath {
181+
#[inline]
182+
fn clone(&self) -> Self {
183+
self.new_ref()
184+
}
185+
}

gdnative-core/src/core_types/rect2.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use super::Vector2;
22

3+
#[derive(Copy, Clone, Debug, PartialEq)]
34
#[repr(C)]
45
pub struct Rect2 {
56
pub position: Vector2,

gdnative-core/src/core_types/transform2d.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use super::Vector2;
22

3+
#[derive(Copy, Clone, Debug, PartialEq)]
34
#[repr(C)]
45
pub struct Transform2D {
56
pub x: Vector2,

gdnative-core/src/core_types/variant.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ macro_rules! decl_variant_type {
113113
///
114114
/// For `Variant`s containing objects, the original `Variant` is returned unchanged, due to
115115
/// the limitations of statically-determined memory management.
116+
#[derive(Clone, Debug)]
116117
#[repr(u32)]
117118
pub enum VariantDispatch {
118119
$(

gdnative-core/src/core_types/variant_array.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,12 @@ impl<T: ToVariant, Access: LocalThreadAccess> Extend<T> for VariantArray<Access>
588588
}
589589
}
590590

591+
impl Clone for VariantArray {
592+
fn clone(&self) -> Self {
593+
self.new_ref()
594+
}
595+
}
596+
591597
godot_test!(test_array {
592598
let foo = Variant::from_str("foo");
593599
let bar = Variant::from_str("bar");

0 commit comments

Comments
 (0)