@@ -95,7 +95,10 @@ impl DurableObject for MyClass {
9595 let bytes = Uint8Array :: new_with_length ( 3 ) ;
9696 bytes. copy_from ( b"123" ) ;
9797 storage. put_raw ( "bytes" , bytes) . await ?;
98- let bytes = storage. get :: < Vec < u8 > > ( "bytes" ) . await ?;
98+ let bytes = storage
99+ . get :: < Vec < u8 > > ( "bytes" )
100+ . await ?
101+ . expect ( "get after put yielded nothing" ) ;
99102 storage. delete ( "bytes" ) . await ?;
100103 assert_eq ! (
101104 bytes, b"123" ,
@@ -117,12 +120,18 @@ impl DurableObject for MyClass {
117120 . await ?;
118121
119122 assert_eq ! (
120- storage. get:: <String >( "thing" ) . await ?,
123+ storage
124+ . get:: <String >( "thing" )
125+ . await ?
126+ . expect( "get('thing') yielded nothing" ) ,
121127 "Hello there" ,
122128 "Didn't put the right thing with put_multiple"
123129 ) ;
124130 assert_eq ! (
125- storage. get:: <i32 >( "other" ) . await ?,
131+ storage
132+ . get:: <i32 >( "other" )
133+ . await ?
134+ . expect( "get('other') yielded nothing" ) ,
126135 56 ,
127136 "Didn't put the right thing with put_multiple"
128137 ) ;
@@ -137,13 +146,16 @@ impl DurableObject for MyClass {
137146 js_sys:: Reflect :: set ( & obj, & JsValue :: from_str ( "foo" ) , & value. into ( ) ) ?;
138147 storage. put_multiple_raw ( obj) . await ?;
139148 assert_eq ! (
140- storage. get:: <Vec <u8 >>( "foo" ) . await ?,
149+ storage
150+ . get:: <Vec <u8 >>( "foo" )
151+ . await ?
152+ . expect( "get('foo') yielded nothing" ) ,
141153 BAR ,
142154 "Didn't the right thing with put_multiple_raw"
143155 ) ;
144156 }
145157
146- * self . number . borrow_mut ( ) = storage. get ( "count" ) . await . unwrap_or ( 0 ) + 1 ;
158+ * self . number . borrow_mut ( ) = storage. get ( "count" ) . await ? . unwrap_or ( 0 ) + 1 ;
147159
148160 storage. delete_all ( ) . await ?;
149161
0 commit comments