-
-
Notifications
You must be signed in to change notification settings - Fork 224
to_gd()
, Gd::try_cast()
result, formatting
#497
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
API docs are being generated and will be shortly available at: https://godot-rust.github.io/docs/gdext/pr-497 |
74d5e59
to
3f78384
Compare
i think also in a situation like this: fn process(&mut self, delta: f64) {
self.some_reference.self_gd()
} it seems a bit less obvious to me that |
cae389c
to
cfd657b
Compare
…cies although never used Can be manually re-enabled. Unfortunately, Cargo doesn't offer optional dev-dependencies. Also remove unused serde_json dependency.
abf84a9
to
c8397b3
Compare
self_gd()
, Gd::try_cast()
result, formattingto_gd()
, Gd::try_cast()
result, formatting
I was also thinking about |
You can now do this:
A
#[base]
field must be present, otherwiseself_gd
(and its extension traitWithBaseField
) is not provided.Also, this changes
Gd::try_cast<U>
from returningOption<Gd<U>>
toResult<Gd<U>, Gd<T>>
.In other words, if the cast fails,
Err(self)
is returned by value. This allows you to re-use the original object for other cast attempts (e.g. when checking against multiple derived classes in a chain).Other changes:
Callable::from_object_method()
now takes its object parameter by shared-ref instead of value, no longer requiring the user to clone or submit ownership.criterion
andserde_json
. The benchmark ingodot-fmt
can be manually re-enabled, but currently the dependencies slow down CI for no reason.sh check.sh clippy
to run--all-targets
like CI.