Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions gdnative-core/src/core_types/dictionary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -544,6 +544,12 @@ where
}
}

impl Clone for Dictionary {
fn clone(&self) -> Self {
self.new_ref()
}
}

godot_test!(test_dictionary {
use std::collections::HashSet;

Expand Down
7 changes: 7 additions & 0 deletions gdnative-core/src/core_types/node_path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -176,3 +176,10 @@ impl fmt::Debug for NodePath {
write!(f, "NodePath({})", self.to_string())
}
}

impl Clone for NodePath {
#[inline]
fn clone(&self) -> Self {
self.new_ref()
}
}
1 change: 1 addition & 0 deletions gdnative-core/src/core_types/rect2.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::Vector2;

#[derive(Copy, Clone, Debug, PartialEq)]
#[repr(C)]
pub struct Rect2 {
pub position: Vector2,
Expand Down
1 change: 1 addition & 0 deletions gdnative-core/src/core_types/transform2d.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::Vector2;

#[derive(Copy, Clone, Debug, PartialEq)]
#[repr(C)]
pub struct Transform2D {
pub x: Vector2,
Expand Down
1 change: 1 addition & 0 deletions gdnative-core/src/core_types/variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ macro_rules! decl_variant_type {
///
/// For `Variant`s containing objects, the original `Variant` is returned unchanged, due to
/// the limitations of statically-determined memory management.
#[derive(Clone, Debug)]
#[repr(u32)]
pub enum VariantDispatch {
$(
Expand Down
6 changes: 6 additions & 0 deletions gdnative-core/src/core_types/variant_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,6 +588,12 @@ impl<T: ToVariant, Access: LocalThreadAccess> Extend<T> for VariantArray<Access>
}
}

impl Clone for VariantArray {
fn clone(&self) -> Self {
self.new_ref()
}
}

godot_test!(test_array {
let foo = Variant::from_str("foo");
let bar = Variant::from_str("bar");
Expand Down