Skip to content

Commit 27e57f6

Browse files
committed
Disable clippy lint 'self-named-constructors' for Null::null()
The following warning (as error) was generated: ------------------------------------------------------- error: constructor `null` has the same name as the type --> gdnative-core\src\object.rs:1023:5 | 1023 | / pub fn null() -> Self { 1024 | | Null(PhantomData) 1025 | | } | |_____^ | = note: `-D clippy::self-named-constructors` implied by `-D clippy::style` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors -------------------------------------------------------
1 parent a22b094 commit 27e57f6

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

gdnative-core/src/object.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1017,8 +1017,10 @@ pub trait AsVariant: AsArg<<Self as AsVariant>::Target> {
10171017
pub struct Null<T>(PhantomData<T>);
10181018

10191019
impl<T: GodotObject> Null<T> {
1020-
/// Creates an explicitly null reference that can be used as a method argument.
1020+
/// Creates an explicit null reference that can be used as a method argument.
1021+
// TODO consider something more idiomatic, like module::null::<T>(), similar to std::ptr::null()
10211022
#[inline]
1023+
#[allow(clippy::self_named_constructors)]
10221024
pub fn null() -> Self {
10231025
Null(PhantomData)
10241026
}

0 commit comments

Comments
 (0)