Skip to content

Commit d3745f8

Browse files
authored
Merge pull request #497 from godot-rust/qol/docs-and-utils
`to_gd()`, `Gd::try_cast()` result, formatting
2 parents 9cca3e0 + c8397b3 commit d3745f8

File tree

29 files changed

+128
-88
lines changed

29 files changed

+128
-88
lines changed

.github/bors.toml

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

.github/workflows/full-ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,7 @@ name: Full CI
88

99
on:
1010
merge_group:
11-
push:
12-
branches:
13-
- staging
14-
- trying
11+
# push:
1512

1613
env:
1714
GDEXT_FEATURES: ''
@@ -328,9 +325,9 @@ jobs:
328325
# CI status report
329326

330327
# Job to notify merge queue about success/failure
331-
# 'push' is for workflows still triggered by bors
332328
ci-status:
333-
if: always() && (github.event_name == 'merge_group' || github.event_name == 'push')
329+
# Check for 'merge_group' not strictly necessary, but helpful when adding add-hoc `push:` trigger to `on:` for testing branch.
330+
if: always() && github.event_name == 'merge_group'
334331
needs:
335332
- rustfmt
336333
- doc-lints

check.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ function cmd_fmt() {
125125
}
126126

127127
function cmd_clippy() {
128-
run cargo clippy "${extraCargoArgs[@]}" -- \
128+
run cargo clippy --all-targets "${extraCargoArgs[@]}" -- \
129129
-D clippy::suspicious \
130130
-D clippy::style \
131131
-D clippy::complexity \

examples/dodge-the-creeps/rust/src/main_scene.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,7 @@ impl Main {
105105
mob.set_linear_velocity(lin_vel);
106106

107107
let mut hud = self.base.get_node_as::<Hud>("Hud");
108-
hud.connect(
109-
"start_game".into(),
110-
Callable::from_object_method(mob, "on_start_game"),
111-
);
108+
hud.connect("start_game".into(), mob.callable("on_start_game"));
112109
}
113110

114111
fn music(&mut self) -> &mut AudioStreamPlayer {

godot-bindings/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ compile_error!(
1919

2020
// This is outside of `godot_version` to allow us to use it even when we don't have the `custom-godot`
2121
// feature enabled.
22-
#[derive(Debug, Eq, PartialEq)]
22+
#[derive(Eq, PartialEq, Debug)]
2323
pub struct GodotVersion {
2424
/// the original string (trimmed, stripped of text around)
2525
pub full_string: String,

godot-codegen/src/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use quote::{format_ident, quote, ToTokens};
1515

1616
use std::fmt;
1717

18-
#[derive(Clone, Debug, PartialEq, Eq)]
18+
#[derive(Clone, Eq, PartialEq, Debug)]
1919
pub struct NativeStructuresField {
2020
pub field_type: String,
2121
pub field_name: String,

godot-core/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ serde = { version = "1", features = ["derive"], optional = true }
3131
# Reverse dev dependencies so doctests can use `godot::` prefix
3232
[dev-dependencies]
3333
godot = { path = "../godot" }
34-
serde_json = "1.0"
3534

3635
[build-dependencies]
3736
godot-bindings = { path = "../godot-bindings" }

godot-core/src/builtin/array.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1022,7 +1022,7 @@ macro_rules! varray {
10221022
/// [`set_typed`](https://docs.godotengine.org/en/latest/classes/class_array.html#class-array-method-set-typed).
10231023
///
10241024
/// We ignore the `script` parameter because it has no impact on typing in Godot.
1025-
#[derive(PartialEq, Eq)]
1025+
#[derive(Eq, PartialEq)]
10261026
pub(crate) struct TypeInfo {
10271027
variant_type: VariantType,
10281028

godot-core/src/builtin/callable.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,10 @@ impl Callable {
3535

3636
/// Create a callable for the method `object::method_name`.
3737
///
38+
/// See also [`Gd::callable()`].
39+
///
3840
/// _Godot equivalent: `Callable(Object object, StringName method)`_
39-
pub fn from_object_method<T, S>(object: Gd<T>, method_name: S) -> Self
41+
pub fn from_object_method<T, S>(object: &Gd<T>, method_name: S) -> Self
4042
where
4143
T: GodotClass, // + Inherits<Object>,
4244
S: Into<StringName>,

godot-core/src/builtin/meta/godot_convert/convert_error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ impl Error for ConvertError {
108108
}
109109
}
110110

111-
#[derive(Debug, PartialEq, Eq)]
111+
#[derive(Eq, PartialEq, Debug)]
112112
pub(crate) enum ErrorKind {
113113
FromGodot(FromGodotError),
114114
FromFfi(FromFfiError),

0 commit comments

Comments
 (0)