Skip to content

Conversation

@sfleener
Copy link
Contributor

@sfleener sfleener commented Jul 6, 2020

Currently, SmartString only implements std::fmt::Debug. This makes it difficult to use as a drop-in replacement for String, especially in format_args contexts such as println:

use smartstring::alias::String;

let s = String::from("hello");
println!("{}", s);

This adds in a simple implementation of std::fmt::Display. This also removes the manual implementation of std::string::ToString, as that has a conflicting blanket implementation for types that implement Display.

@bodil
Copy link
Owner

bodil commented Jul 6, 2020

Wow, weird omission on my part. Thanks for the impl.

@bodil bodil merged commit 2162ca1 into bodil:master Jul 6, 2020
@djc
Copy link
Contributor

djc commented Jul 7, 2020

Was also looking for this. Are you planning on pushing this out into a release soon? :)

@bodil
Copy link
Owner

bodil commented Jul 7, 2020

It's in crates.io now.

@djc
Copy link
Contributor

djc commented Jul 7, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants