Skip to content

Commit

Permalink
s/clamp(x, y)/max(x).min(y), update UI variant_fail tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Demindiro committed Mar 29, 2021
1 parent 7c45702 commit 411e542
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions examples/dodge_the_creeps/src/player.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ impl Player {
let change = velocity * delta;
let position = owner.global_position() + change;
let position = Vector2::new(
position.x.clamp(0.0, self.screen_size.x),
position.y.clamp(0.0, self.screen_size.y),
position.x.max(0.0).min(self.screen_size.x),
position.y.max(0.0).min(self.screen_size.y),
);
owner.set_global_position(position);
}
Expand Down
4 changes: 2 additions & 2 deletions gdnative/tests/ui/from_variant_fail_01.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error: Missing macro arguments
expecting #[variant(...)]. See documentation:
https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes
expecting #[variant(...)]. See documentation:
https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes
--> $DIR/from_variant_fail_01.rs:5:7
|
5 | #[variant]
Expand Down
6 changes: 3 additions & 3 deletions gdnative/tests/ui/from_variant_fail_02.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: Invalid syntax
expecting #[variant(...)]. See documentation:
https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes
expecting #[variant(...)]. See documentation:
https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes
--> $DIR/from_variant_fail_02.rs:6:15
|
6 | #[variant(baz::quux)]
| ^^^
| ^^^^^^^^^
4 changes: 2 additions & 2 deletions gdnative/tests/ui/from_variant_fail_03.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error: Found baz::quux, expected one of:
to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip
to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip
--> $DIR/from_variant_fail_03.rs:6:15
|
6 | #[variant(baz::quux = "path::to::function")]
| ^^^
| ^^^^^^^^^
2 changes: 1 addition & 1 deletion gdnative/tests/ui/from_variant_fail_07.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: unknown argument, expected one of:
to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip
to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip
--> $DIR/from_variant_fail_07.rs:5:15
|
5 | #[variant(aoeu = "aoeu")]
Expand Down
4 changes: 2 additions & 2 deletions gdnative/tests/ui/to_variant_fail_01.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error: Missing macro arguments
expecting #[variant(...)]. See documentation:
https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes
expecting #[variant(...)]. See documentation:
https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes
--> $DIR/to_variant_fail_01.rs:5:7
|
5 | #[variant]
Expand Down
6 changes: 3 additions & 3 deletions gdnative/tests/ui/to_variant_fail_02.stderr
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
error: Invalid syntax
expecting #[variant(...)]. See documentation:
https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes
expecting #[variant(...)]. See documentation:
https://docs.rs/gdnative/0.9.0/gdnative/core_types/trait.ToVariant.html#field-attributes
--> $DIR/to_variant_fail_02.rs:6:15
|
6 | #[variant(baz::quux)]
| ^^^
| ^^^^^^^^^
4 changes: 2 additions & 2 deletions gdnative/tests/ui/to_variant_fail_03.stderr
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
error: Found baz::quux, expected one of:
to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip
to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip
--> $DIR/to_variant_fail_03.rs:6:15
|
6 | #[variant(baz::quux = "path::to::function")]
| ^^^
| ^^^^^^^^^
2 changes: 1 addition & 1 deletion gdnative/tests/ui/to_variant_fail_07.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: unknown argument, expected one of:
to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip
to_variant_with, from_variant_with, with, skip_to_variant, skip_from_variant, skip
--> $DIR/to_variant_fail_07.rs:5:15
|
5 | #[variant(aoeu = "aoeu")]
Expand Down

0 comments on commit 411e542

Please sign in to comment.