replace ~str by &str
more &str
more &str + remove unnecessary alloc on example