> try wrapping the expression in `summary::FileContent::Text`
This rust-analyzer feature amazed me. I'd changed an API from taking a &str to a Text(String) and it offered a quick fix to correct the call sites!
miniblog.
Related Posts
I've been using "Expected Int, but got String" for my type error messages, but I've been wondering if I could do better.
"Expected Int here, but this value has type String" or "This expression requires Int, but the value is String".
Do you have a favourite?
I've added syntax highlighting to the prompt of my programming language!
It's not strictly necessary, but it's nice to have. It caught a bug with lexing incomplete string literals too.
When writing long-lived programs (daemons etc) in Rust, I find myself asking *where* I should put data.
In a GC'd language it's just "I have a string" but Rust forces me to find somewhere to put it.
You do get a performance benefit for this work though.