Skip to content

Commit bee643e

Browse files
bors[bot]chitoyuu
andauthored
Merge #1016
1016: Remove specialized pool array aliases r=chitoyuu a=chitoyuu These type aliases were deprecated in 0.11, and are now removed. Also in the process: - Genericized access tests, reducing duplicate code. - Removed tests of `Debug` formattings. The Debug representations of standard types aren't stablized, so these hard coded strings can break at any time. Additionally, the impl itself is trivial, so there isn't much benefit to be had from the tests in the first place. Co-authored-by: Chitose Yuuzaki <chitoyuu@potatoes.gay>
2 parents 91e1b77 + 4652e05 commit bee643e

File tree

14 files changed

+130
-447
lines changed

14 files changed

+130
-447
lines changed

check.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ function findGodot() {
6262
fi
6363
}
6464

65-
features="gdnative/async,gdnative/serde,gdnative/inventory"
66-
itest_toggled_features="no-manual-register"
65+
features="gdnative/async,gdnative/serde"
66+
itest_toggled_features="gdnative/inventory,no-manual-register"
6767
cmds=()
6868

6969
for arg in "${args[@]}"; do

gdnative-core/src/core_types/byte_array.rs

Lines changed: 0 additions & 55 deletions
This file was deleted.

gdnative-core/src/core_types/color_array.rs

Lines changed: 0 additions & 63 deletions
This file was deleted.

gdnative-core/src/core_types/float32_array.rs

Lines changed: 0 additions & 49 deletions
This file was deleted.

gdnative-core/src/core_types/int32_array.rs

Lines changed: 0 additions & 45 deletions
This file was deleted.

gdnative-core/src/core_types/mod.rs

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,45 +8,31 @@
88
mod geom;
99

1010
mod access;
11-
mod byte_array;
1211
mod color;
13-
mod color_array;
1412
mod dictionary;
1513
mod error;
16-
mod float32_array;
17-
mod int32_array;
1814
mod node_path;
1915
mod pool_array;
2016
mod rid;
2117
mod string;
22-
mod string_array;
2318
mod variant;
2419
mod variant_array;
2520
mod vector2;
26-
mod vector2_array;
2721
mod vector3;
28-
mod vector3_array;
2922

3023
pub use access::*;
31-
pub use byte_array::*;
3224
pub use color::*;
33-
pub use color_array::*;
3425
pub use dictionary::*;
3526
pub use error::{GodotError, GodotResult};
36-
pub use float32_array::*;
3727
pub use geom::*;
38-
pub use int32_array::*;
3928
pub use node_path::*;
4029
pub use pool_array::*;
4130
pub use rid::*;
4231
pub use string::*;
43-
pub use string_array::*;
4432
pub use variant::*;
4533
pub use variant_array::*;
4634
pub use vector2::*;
47-
pub use vector2_array::*;
4835
pub use vector3::*;
49-
pub use vector3_array::*;
5036

5137
use approx::relative_eq;
5238

gdnative-core/src/core_types/pool_array.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ use crate::core_types::{Color, GodotString, VariantArray, Vector2, Vector3};
88
use crate::object::NewRef;
99
use crate::private::get_api;
1010

11+
#[cfg(feature = "gd-test")]
12+
mod godot_tests;
13+
#[cfg(feature = "gd-test")]
14+
pub use godot_tests::*;
15+
1116
/// A RAII read access for Godot pool arrays.
1217
pub type Read<'a, T> = Aligned<ReadGuard<'a, T>>;
1318

@@ -68,15 +73,14 @@ impl<T: PoolElement> PoolArray<T> {
6873
///
6974
/// For example:
7075
/// ```no_run
71-
/// // Int32Array is a type alias for PoolArray<i32>
72-
/// use gdnative::core_types::Int32Array;
76+
/// use gdnative::core_types::PoolArray;
7377
///
7478
/// // Collect from range
75-
/// let arr = (0..4).collect::<Int32Array>();
79+
/// let arr = (0i32..4).collect::<PoolArray<_>>();
7680
///
7781
/// // Type conversion
7882
/// let vec: Vec<u32> = vec![1, 1, 2, 3, 5]; // note: unsigned
79-
/// let arr = vec.iter().map(|&e| e as i32).collect::<Int32Array>();
83+
/// let arr = vec.iter().map(|&e| e as i32).collect::<PoolArray<_>>();
8084
/// ```
8185
#[inline]
8286
pub fn from_vec(mut src: Vec<T>) -> Self {

0 commit comments

Comments
 (0)