File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 7272 Ok ( updated)
7373 }
7474
75- pub ( crate ) fn insert_or_update ( & self , object : & SO ) -> Result < bool , Error > {
75+ pub ( crate ) fn insert_or_update ( & self , object : SO ) -> Result < bool , Error > {
7676 let mut locked_objects = self . objects . lock ( ) . unwrap ( ) ;
7777
7878 let updated;
@@ -274,14 +274,14 @@ mod tests {
274274 // Check `insert_or_update` inserts unknown objects
275275 let iou_id = TestObjectId { id : [ 55u8 ; 4 ] } ;
276276 let iou_object = TestObject { id : iou_id, data : [ 34u8 ; 3 ] } ;
277- assert_eq ! ( Ok ( true ) , data_store. insert_or_update( & iou_object) ) ;
277+ assert_eq ! ( Ok ( true ) , data_store. insert_or_update( iou_object. clone ( ) ) ) ;
278278
279279 // Check `insert_or_update` doesn't update the same object
280- assert_eq ! ( Ok ( false ) , data_store. insert_or_update( & iou_object) ) ;
280+ assert_eq ! ( Ok ( false ) , data_store. insert_or_update( iou_object. clone ( ) ) ) ;
281281
282282 // Check `insert_or_update` updates if object changed
283- let mut new_iou_object = iou_object. clone ( ) ;
283+ let mut new_iou_object = iou_object;
284284 new_iou_object. data [ 0 ] += 1 ;
285- assert_eq ! ( Ok ( true ) , data_store. insert_or_update( & new_iou_object) ) ;
285+ assert_eq ! ( Ok ( true ) , data_store. insert_or_update( new_iou_object) ) ;
286286 }
287287}
You can’t perform that action at this time.
0 commit comments