Skip to content

Commit c3f705b

Browse files
authored
Merge pull request #1347 from arocull/fix-callable-from-sync-fn-docs
doc: fix Callable::from_sync_fn example using deprecated Result<T> return
2 parents 462f285 + 3b92998 commit c3f705b

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

godot-core/src/builtin/callable.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ impl Callable {
282282
/// # use godot::prelude::*;
283283
/// let callable = Callable::from_sync_fn("sum", |args: &[&Variant]| {
284284
/// let sum: i32 = args.iter().map(|arg| arg.to::<i32>()).sum();
285-
/// Ok(sum.to_variant())
285+
/// sum
286286
/// });
287287
/// ```
288288
#[cfg(feature = "experimental-threads")]
@@ -630,9 +630,7 @@ mod custom_callable {
630630
pub trait RustCallable: 'static + PartialEq + Hash + fmt::Display + Send + Sync {
631631
/// Invokes the callable with the given arguments as `Variant` references.
632632
///
633-
/// Return `Ok(...)` if the call succeeded, and `Err(())` otherwise.
634-
/// Error handling is mostly needed in case argument number or types mismatch.
635-
#[allow(clippy::result_unit_err)] // TODO remove once there's a clear error type here.
633+
/// Errors are supported via panics.
636634
fn invoke(&mut self, args: &[&Variant]) -> Variant;
637635

638636
// TODO(v0.5): add object_id().

0 commit comments

Comments
 (0)