Skip to content

Commit 37af2b0

Browse files
committed
fixed doc string indentation, added clarification on test assertions
1 parent 32f0e2c commit 37af2b0

File tree

7 files changed

+11
-10
lines changed

7 files changed

+11
-10
lines changed

godot-core/src/builtin/collections/array.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,12 @@ impl<T: ArrayElement> Array<T> {
285285
self.as_inner().is_empty()
286286
}
287287

288-
crate::declare_hash_u32_method! {/// Returns a 32-bit integer hash value representing the array and its contents.
289-
///
290-
/// Note: Arrays with equal content will always produce identical hash values. However, the
291-
/// reverse is not true. Returning identical hash values does not imply the arrays are equal,
292-
/// because different arrays can have identical hash values due to hash collisions.
288+
crate::declare_hash_u32_method! {
289+
/// Returns a 32-bit integer hash value representing the array and its contents.
290+
///
291+
/// Note: Arrays with equal content will always produce identical hash values. However, the
292+
/// reverse is not true. Returning identical hash values does not imply the arrays are equal,
293+
/// because different arrays can have identical hash values due to hash collisions.
293294
}
294295

295296
#[deprecated = "renamed to hash_u32"]

godot-core/src/builtin/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ pub mod inner {
116116
pub use crate::gen::builtin_classes::*;
117117
}
118118

119-
// common hashing macro implementer
120119
#[macro_export]
121120
macro_rules! declare_hash_u32_method {
122121
($ ($docs:tt)+ ) => {

itest/rust/src/builtin_tests/containers/dictionary_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ fn dictionary_hash() {
132132
"equal dictionaries have same hash"
133133
);
134134

135+
// Not guaranteed, but very likely
135136
assert_ne!(
136137
a.hash_u32(),
137138
c.hash_u32(),

itest/rust/src/builtin_tests/containers/variant_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ fn variant_hash() {
726726
assert_eq!(v_first, v_second);
727727
assert_eq!(v_first.hash_u32(), v_second.hash_u32());
728728
assert_ne!(v_first, v_third);
729-
assert_ne!(v_first.hash_u32(), v_third.hash_u32());
729+
assert_ne!(v_first.hash_u32(), v_third.hash_u32()); //not guaranteed but very likely
730730

731731
assert_eq!(Variant::nil().hash_u32(), 0);
732732

itest/rust/src/builtin_tests/string/gstring_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn string_equality() {
3939
assert_eq!(string, second);
4040
assert_eq!(string.hash_u32(), second.hash_u32());
4141
assert_ne!(string, different);
42-
assert_ne!(string.hash_u32(), different.hash_u32());
42+
assert_ne!(string.hash_u32(), different.hash_u32()); //not guaranteed, but very likely
4343
}
4444

4545
#[itest]

itest/rust/src/builtin_tests/string/node_path_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ fn node_path_equality() {
3838
assert_eq!(string, second);
3939
assert_eq!(string.hash_u32(), second.hash_u32());
4040
assert_ne!(string, different);
41-
assert_ne!(string.hash_u32(), different.hash_u32());
41+
assert_ne!(string.hash_u32(), different.hash_u32()); //not guaranteed, but very likely
4242
}
4343

4444
#[itest]

itest/rust/src/builtin_tests/string/string_name_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ fn string_name_equality() {
4848
assert_eq!(string, second);
4949
assert_eq!(string.hash_u32(), second.hash_u32());
5050
assert_ne!(string, different);
51-
assert_ne!(string.hash_u32(), different.hash_u32());
51+
assert_ne!(string.hash_u32(), different.hash_u32()); //not guaranteed, but very likely
5252
}
5353

5454
#[itest]

0 commit comments

Comments
 (0)