diff --git a/src/bin/rhai-dbg.rs b/src/bin/rhai-dbg.rs index 69ad15837..d3fbdfb4f 100644 --- a/src/bin/rhai-dbg.rs +++ b/src/bin/rhai-dbg.rs @@ -63,7 +63,7 @@ fn print_current_source( .global_runtime_state_mut() .debugger_mut() .state_mut() - .as_immutable_string_ref_mut() + .as_immutable_string_mut() .unwrap(); let src = source.unwrap_or(""); if src != current_source { diff --git a/src/func/builtin.rs b/src/func/builtin.rs index 061eb6e77..a7dd2460a 100644 --- a/src/func/builtin.rs +++ b/src/func/builtin.rs @@ -792,7 +792,7 @@ pub fn get_builtin_op_assignment_fn(op: &Token, x: &Dynamic, y: &Dynamic) -> Opt PlusAssign => Some(( |_ctx, args| { let (first, second) = args.split_first_mut().unwrap(); - let x = &mut *first.as_immutable_string_ref_mut().unwrap(); + let x = &mut *first.as_immutable_string_mut().unwrap(); let y = &*second[0].as_immutable_string_ref().unwrap(); #[cfg(not(feature = "unchecked"))] @@ -810,7 +810,7 @@ pub fn get_builtin_op_assignment_fn(op: &Token, x: &Dynamic, y: &Dynamic) -> Opt MinusAssign => Some(( |_, args| { let (first, second) = args.split_first_mut().unwrap(); - let x = &mut *first.as_immutable_string_ref_mut().unwrap(); + let x = &mut *first.as_immutable_string_mut().unwrap(); let y = &*second[0].as_immutable_string_ref().unwrap(); *x -= y; Ok(Dynamic::UNIT) @@ -843,7 +843,7 @@ pub fn get_builtin_op_assignment_fn(op: &Token, x: &Dynamic, y: &Dynamic) -> Opt )?; } - let array = &mut *args[0].as_array_ref_mut().unwrap(); + let array = &mut *args[0].as_array_mut().unwrap(); append(array, x); @@ -864,7 +864,7 @@ pub fn get_builtin_op_assignment_fn(op: &Token, x: &Dynamic, y: &Dynamic) -> Opt PlusAssign => Some(( |_ctx, args| { let blob2 = args[1].take().into_blob().unwrap(); - let blob1 = &mut *args[0].as_blob_ref_mut().unwrap(); + let blob1 = &mut *args[0].as_blob_mut().unwrap(); #[cfg(not(feature = "unchecked"))] _ctx.unwrap() @@ -954,7 +954,7 @@ pub fn get_builtin_op_assignment_fn(op: &Token, x: &Dynamic, y: &Dynamic) -> Opt |_ctx, args| { let mut buf = [0_u8; 4]; let ch = &*args[1].as_char().unwrap().encode_utf8(&mut buf); - let mut x = args[0].as_immutable_string_ref_mut().unwrap(); + let mut x = args[0].as_immutable_string_mut().unwrap(); #[cfg(not(feature = "unchecked"))] _ctx.unwrap() @@ -1015,7 +1015,7 @@ pub fn get_builtin_op_assignment_fn(op: &Token, x: &Dynamic, y: &Dynamic) -> Opt |_ctx, args| { { let x = args[1].take(); - let array = &mut *args[0].as_array_ref_mut().unwrap(); + let array = &mut *args[0].as_array_mut().unwrap(); push(array, x); } @@ -1045,7 +1045,7 @@ pub fn get_builtin_op_assignment_fn(op: &Token, x: &Dynamic, y: &Dynamic) -> Opt PlusAssign => Some(( |_ctx, args| { let x = args[1].as_int().unwrap(); - let blob = &mut *args[0].as_blob_ref_mut().unwrap(); + let blob = &mut *args[0].as_blob_mut().unwrap(); #[cfg(not(feature = "unchecked"))] _ctx.unwrap() @@ -1071,7 +1071,7 @@ pub fn get_builtin_op_assignment_fn(op: &Token, x: &Dynamic, y: &Dynamic) -> Opt PlusAssign => Some(( |_ctx, args| { let x = args[1].as_char().unwrap(); - let blob = &mut *args[0].as_blob_ref_mut().unwrap(); + let blob = &mut *args[0].as_blob_mut().unwrap(); #[cfg(not(feature = "unchecked"))] _ctx.unwrap() @@ -1097,7 +1097,7 @@ pub fn get_builtin_op_assignment_fn(op: &Token, x: &Dynamic, y: &Dynamic) -> Opt PlusAssign => Some(( |_ctx, args| { let (first, second) = args.split_first_mut().unwrap(); - let blob = &mut *first.as_blob_ref_mut().unwrap(); + let blob = &mut *first.as_blob_mut().unwrap(); let s = &*second[0].as_immutable_string_ref().unwrap(); if s.is_empty() { diff --git a/src/types/dynamic.rs b/src/types/dynamic.rs index d0bf775bb..9aaf4d031 100644 --- a/src/types/dynamic.rs +++ b/src/types/dynamic.rs @@ -2545,7 +2545,7 @@ impl Dynamic { /// /// These normally shouldn't occur since most operations in Rhai are single-threaded. #[inline] - pub fn as_immutable_string_ref_mut( + pub fn as_immutable_string_mut( &mut self, ) -> Result + '_, &'static str> { let type_name = self.type_name(); @@ -2590,7 +2590,7 @@ impl Dynamic { /// These normally shouldn't occur since most operations in Rhai are single-threaded. #[cfg(not(feature = "no_index"))] #[inline(always)] - pub fn as_array_ref_mut(&mut self) -> Result + '_, &'static str> { + pub fn as_array_mut(&mut self) -> Result + '_, &'static str> { let type_name = self.type_name(); self.write_lock::().ok_or(type_name) } @@ -2633,7 +2633,7 @@ impl Dynamic { /// These normally shouldn't occur since most operations in Rhai are single-threaded. #[cfg(not(feature = "no_index"))] #[inline(always)] - pub fn as_blob_ref_mut(&mut self) -> Result + '_, &'static str> { + pub fn as_blob_mut(&mut self) -> Result + '_, &'static str> { let type_name = self.type_name(); self.write_lock::().ok_or(type_name) } @@ -2676,7 +2676,7 @@ impl Dynamic { /// These normally shouldn't occur since most operations in Rhai are single-threaded. #[cfg(not(feature = "no_object"))] #[inline(always)] - pub fn as_map_ref_mut(&mut self) -> Result + '_, &'static str> { + pub fn as_map_mut(&mut self) -> Result + '_, &'static str> { let type_name = self.type_name(); self.write_lock::().ok_or(type_name) } diff --git a/tests/debugging.rs b/tests/debugging.rs index 67bd5bf9e..3228aac77 100644 --- a/tests/debugging.rs +++ b/tests/debugging.rs @@ -58,7 +58,7 @@ fn test_debugger_state() { println!("Current state = {}", context.global_runtime_state().debugger().state()); // Modify state - let mut state = context.global_runtime_state_mut().debugger_mut().state_mut().as_map_ref_mut().unwrap(); + let mut state = context.global_runtime_state_mut().debugger_mut().state_mut().as_map_mut().unwrap(); let hello = state.get("hello").unwrap().as_int().unwrap(); state.insert("hello".into(), (hello + 1).into()); state.insert("foo".into(), true.into());