Skip to content

Commit 8f8adb0

Browse files
committed
Consistent #[derive] order and minor formatting
1 parent e8f25ee commit 8f8adb0

File tree

12 files changed

+19
-19
lines changed

12 files changed

+19
-19
lines changed

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/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/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),

godot-core/src/builtin/vectors/vector_axis.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ pub trait ToVector: Sized {
7373
}
7474

7575
/// Enumerates the axes in a [`Vector2`].
76-
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
76+
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
7777
#[repr(i32)]
7878
pub enum Vector2Axis {
7979
/// The X axis.
@@ -117,7 +117,7 @@ impl FromGodot for Vector2Axis {
117117

118118
/// Enumerates the axes in a [`Vector3`].
119119
// TODO auto-generate this, alongside all the other builtin type's enums
120-
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
120+
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
121121
#[repr(i32)]
122122
pub enum Vector3Axis {
123123
/// The X axis.
@@ -164,7 +164,7 @@ impl FromGodot for Vector3Axis {
164164
// ----------------------------------------------------------------------------------------------------------------------------------------------
165165

166166
/// Enumerates the axes in a [`Vector4`].
167-
#[derive(Copy, Clone, Debug, Eq, Ord, PartialEq, PartialOrd)]
167+
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Debug)]
168168
#[repr(i32)]
169169
pub enum Vector4Axis {
170170
/// The X axis.

godot-fmt/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ fn indent(n: usize) -> &'static str {
8888
/// State that is kept between processing `TokenTree`s, used to decide
8989
/// how to insert whitespace.
9090
91-
#[derive(Clone, Copy, PartialEq, Eq)]
91+
#[derive(Copy, Clone, Eq, PartialEq)]
9292
enum FormatState {
9393
/// Starting state, meaning no whitespace is needed
9494
Start,

godot-macros/src/derive/derive_from_variant.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,8 +261,8 @@ fn make_enum_tuple(
261261
} else {
262262
quote! {
263263
let #ident = variant.pop_front()
264-
.ok_or(ConvertError::with_cause_value("missing expected value", variant.clone()))?
265-
.try_to::<#field_type>()?;
264+
.ok_or(ConvertError::with_cause_value("missing expected value", variant.clone()))?
265+
.try_to::<#field_type>()?;
266266
}
267267
};
268268
(ident.to_token_stream(), set_ident)

godot-macros/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ pub fn derive_from_godot(input: TokenStream) -> TokenStream {
529529
/// # use godot::prelude::*;
530530
/// #[repr(i32)]
531531
/// #[derive(Property)]
532-
/// # #[derive(PartialEq, Eq, Debug)]
532+
/// # #[derive(Eq, PartialEq, Debug)]
533533
/// enum TestEnum {
534534
/// A = 0,
535535
/// B = 1,

itest/rust/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ macro_rules! push_newtype {
7777
pushs!(
7878
$inputs; $GDScriptTy, $name, $gdscript_val, $rust_val, false, false, None;
7979

80-
#[derive(Debug, Clone, PartialEq)]
80+
#[derive(Clone, PartialEq, Debug)]
8181
pub struct $name($T);
8282

8383
impl godot::builtin::meta::GodotConvert for $name {

itest/rust/src/builtin_tests/convert_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ fn error_maintains_value() {
9292
}
9393

9494
// Manual implementation of `GodotConvert` and related traits to ensure conversion works.
95-
#[derive(Debug, PartialEq)]
95+
#[derive(PartialEq, Debug)]
9696
struct Foo {
9797
a: i32,
9898
b: f32,

0 commit comments

Comments
 (0)