Skip to content

Commit 0ef2ad3

Browse files
committed
Remove deprecated Share trait
1 parent 5effee3 commit 0ef2ad3

File tree

5 files changed

+2
-31
lines changed

5 files changed

+2
-31
lines changed

godot-core/src/builtin/array.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use godot_ffi as sys;
99

1010
use crate::builtin::*;
11-
use crate::obj::Share;
1211
use crate::property::{Export, Property, PropertyHintInfo, TypeStringHint};
1312
use std::fmt;
1413
use std::marker::PhantomData;
@@ -718,12 +717,6 @@ impl<T: GodotType> Clone for Array<T> {
718717
}
719718
}
720719

721-
impl<T: GodotType> Share for Array<T> {
722-
fn share(&self) -> Self {
723-
self.clone()
724-
}
725-
}
726-
727720
impl<T: GodotType + TypeStringHint> TypeStringHint for Array<T> {
728721
fn type_string() -> String {
729722
format!("{}:{}", VariantType::Array as i32, T::type_string())

godot-core/src/builtin/dictionary.rs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ use godot_ffi as sys;
99

1010
use crate::builtin::meta::{FromGodot, ToGodot};
1111
use crate::builtin::{inner, Variant};
12-
use crate::obj::Share;
1312
use crate::property::{Export, Property, PropertyHintInfo, TypeStringHint};
1413
use std::fmt;
1514
use std::marker::PhantomData;
@@ -340,12 +339,6 @@ impl Clone for Dictionary {
340339
}
341340
}
342341

343-
impl Share for Dictionary {
344-
fn share(&self) -> Self {
345-
self.clone()
346-
}
347-
}
348-
349342
impl Property for Dictionary {
350343
type Intermediate = Self;
351344

godot-core/src/obj/gd.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::builtin::meta::{
1616
ConvertError, FromFfiError, FromGodot, GodotConvert, GodotType, ToGodot,
1717
};
1818
use crate::builtin::{Callable, StringName};
19-
use crate::obj::{cap, dom, mem, EngineEnum, GdDerefTarget, GodotClass, Inherits, Share};
19+
use crate::obj::{cap, dom, mem, EngineEnum, GdDerefTarget, GodotClass, Inherits};
2020
use crate::obj::{GdMut, GdRef, InstanceId};
2121
use crate::property::{Export, Property, PropertyHintInfo, TypeStringHint};
2222
use crate::{callbacks, engine, out};
@@ -596,12 +596,6 @@ impl<T: GodotClass> Clone for Gd<T> {
596596
}
597597
}
598598

599-
impl<T: GodotClass> Share for Gd<T> {
600-
fn share(&self) -> Self {
601-
self.clone()
602-
}
603-
}
604-
605599
impl<T: GodotClass> TypeStringHint for Gd<T> {
606600
fn type_string() -> String {
607601
use engine::global::PropertyHint;

godot-core/src/obj/traits.rs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,6 @@ unsafe impl GodotClass for () {
7777
}
7878
}
7979

80-
/// Trait to create more references from a smart pointer or collection.
81-
pub trait Share {
82-
/// Creates a new reference that points to the same object.
83-
///
84-
/// If the referred-to object is reference-counted, this will increment the count.
85-
#[deprecated = "Replaced with `Clone::clone()`."]
86-
fn share(&self) -> Self;
87-
}
88-
8980
/// Non-strict inheritance relationship in the Godot class hierarchy.
9081
///
9182
/// `Derived: Inherits<Base>` means that either `Derived` is a subclass of `Base`, or the class `Base` itself (hence "non-strict").

godot/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ pub mod prelude {
236236
pub use super::init::{gdextension, ExtensionLibrary, InitLevel};
237237
pub use super::log::*;
238238
pub use super::obj::{
239-
Base, Gd, GdMut, GdRef, GodotClass, Inherits, InstanceId, OnReady, Share,
239+
Base, Gd, GdMut, GdRef, GodotClass, Inherits, InstanceId, OnReady,
240240
};
241241

242242
// Make trait methods available

0 commit comments

Comments
 (0)