Add an implementation of FromStr for ~str and @str

This fixes an issue for APIs that return FromStr. Before this change,
they would have to offer a seperate function for returning the source
string.