Skip to content

Commit b150cf6

Browse files
GEFNENENcloutiertylerclockwork-labs-botbfops
authored
align UUID reducer examples with allowed signatures (#3999)
# Description of Changes - Corrected UUID v4/v7 reducer documentation examples to use valid reducer signatures returning ()/Result<(), E> # API and ABI breaking changes - None # Expected complexity level and risk - 1 (doc example corrections only) # Testing - [ ] Not run (docs-only change) - [ ] Please review documentation formatting and correctness --------- Signed-off-by: miXin <52082254@qq.com> Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com> Co-authored-by: clockwork-labs-bot <clockwork-labs-bot@users.noreply.github.com> Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
1 parent 4dd2d29 commit b150cf6

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

crates/bindings/src/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1110,9 +1110,10 @@ impl ReducerContext {
11101110
/// use spacetimedb::{reducer, ReducerContext, Uuid};
11111111
///
11121112
/// #[reducer]
1113-
/// fn generate_uuid_v4(ctx: &ReducerContext) -> Uuid {
1114-
/// let uuid = ctx.new_uuid_v4();
1113+
/// fn generate_uuid_v4(ctx: &ReducerContext) -> Result<(), Box<dyn std::error::Error>> {
1114+
/// let uuid = ctx.new_uuid_v4()?;
11151115
/// log::info!(uuid);
1116+
/// Ok(())
11161117
/// }
11171118
/// # }
11181119
/// ```
@@ -1131,9 +1132,10 @@ impl ReducerContext {
11311132
/// use spacetimedb::{reducer, ReducerContext, Uuid};
11321133
///
11331134
/// #[reducer]
1134-
/// fn generate_uuid_v7(ctx: &ReducerContext) -> Result<Uuid, Box<dyn std::error::Error>> {
1135+
/// fn generate_uuid_v7(ctx: &ReducerContext) -> Result<(), Box<dyn std::error::Error>> {
11351136
/// let uuid = ctx.new_uuid_v7()?;
11361137
/// log::info!(uuid);
1138+
/// Ok(())
11371139
/// }
11381140
/// # }
11391141
/// ```

0 commit comments

Comments
 (0)