DEV Community

Discussion on: A common coding interview question

Collapse
 
gabgab2003 profile image
DownloadPizza

Is there any difference between

String::from("")

and

"".to_owned()

?

Collapse
 
idanarye profile image
Idan Arye

None that I'm aware of. I prefer "".to_owned() over String::from("") or "".to_string() to avoid the confusion of "why are you converting a string to a string?" that I've seen in some newbie Rust threads.