From Colorize trait doc, String doesn't impl it (whereas &str impls it).
fn blue(self) -> ColoredString
where
Self: Sized,
But why String type can call its method?
use colored::Colorize;
fn main() {
let blue = "blue".to_owned().blue();
println!("{}", blue);
}
edits
[unresolved] How can I desugar it? (specifically, to figure out auto deref is happening)
What's happening under the hood?
Type coercion on method calls. String can be coerced to &str by &*String