Replace ~"string" with "string".to_owned().