What is the most efficient way to prepend a &str to a String? Right now I am allocating a new String and pushing to it:
fn push_front(s: String, prefix: &str) -> String {
let prefix = prefix.to_owned();
prefix.push_str(&s);
prefix
}
Is there a more efficient way? I don't see a String::push_front function in the standard library.