From 980aba77a9f037b68531fb9bc4c8ec9d6eb7a080 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Wed, 19 Aug 2020 12:53:33 +0800 Subject: [PATCH] Use &mut. --- src/packages/string_more.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/packages/string_more.rs b/src/packages/string_more.rs index 087e8e90..99af280d 100644 --- a/src/packages/string_more.rs +++ b/src/packages/string_more.rs @@ -22,12 +22,12 @@ macro_rules! gen_concat_functions { use super::super::*; #[export_fn] - pub fn append_func(x: ImmutableString, y: $arg_type) -> String { + pub fn append_func(x: &mut ImmutableString, y: $arg_type) -> String { super::super::add_append(x, y) } #[export_fn] - pub fn prepend_func(x: $arg_type, y: ImmutableString) -> String { + pub fn prepend_func(x: &mut $arg_type, y: ImmutableString) -> String { super::super::add_prepend(x, y) } } @@ -120,10 +120,10 @@ def_package!(crate:MoreStringPackage:"Additional string utilities, including str ); }); -fn add_prepend(x: T, y: ImmutableString) -> String { +fn add_prepend(x: &mut T, y: ImmutableString) -> String { format!("{}{}", x, y) } -fn add_append(x: ImmutableString, y: T) -> String { +fn add_append(x: &mut ImmutableString, y: T) -> String { format!("{}{}", x, y) }