Use &mut.
This commit is contained in:
parent
c55b0d7883
commit
980aba77a9
@ -22,12 +22,12 @@ macro_rules! gen_concat_functions {
|
|||||||
use super::super::*;
|
use super::super::*;
|
||||||
|
|
||||||
#[export_fn]
|
#[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)
|
super::super::add_append(x, y)
|
||||||
}
|
}
|
||||||
|
|
||||||
#[export_fn]
|
#[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)
|
super::super::add_prepend(x, y)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -120,10 +120,10 @@ def_package!(crate:MoreStringPackage:"Additional string utilities, including str
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
fn add_prepend<T: Display>(x: T, y: ImmutableString) -> String {
|
fn add_prepend<T: Display>(x: &mut T, y: ImmutableString) -> String {
|
||||||
format!("{}{}", x, y)
|
format!("{}{}", x, y)
|
||||||
}
|
}
|
||||||
fn add_append<T: Display>(x: ImmutableString, y: T) -> String {
|
fn add_append<T: Display>(x: &mut ImmutableString, y: T) -> String {
|
||||||
format!("{}{}", x, y)
|
format!("{}{}", x, y)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user