From be941bb742d4338ead2f8024b27486a025b05e9c Mon Sep 17 00:00:00 2001 From: Eric Seppanen <109770420+eric-seppanen@users.noreply.github.com> Date: Mon, 19 Feb 2024 07:01:20 -0800 Subject: [PATCH] fix docs typos in `DurableObject` (#431) * fix docs typos in worker::durable::DurableObject Fix a syntax error (missing comma) and remove a blank line. * docs: Remove redundant field name in assignment If clippy were able to see the code in examples, this would trigger `clippy::redundant_field_names`. --- worker/src/durable.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/worker/src/durable.rs b/worker/src/durable.rs index a99f54a5..9a03bfd4 100644 --- a/worker/src/durable.rs +++ b/worker/src/durable.rs @@ -713,10 +713,9 @@ use worker::*; #[durable_object] pub struct Chatroom { users: Vec, - messages: Vec + messages: Vec, state: State, env: Env, // access `Env` across requests, use inside `fetch` - } #[durable_object] @@ -725,7 +724,7 @@ impl DurableObject for Chatroom { Self { users: vec![], messages: vec![], - state: state, + state, env, } }