logoalt Hacker News

YuechenLi • today at 2:12 AM • 2 replies • view on HN

Idiomatic Rust seemed to always use a ton of method chaining much more than any other language, even TypeScript, so a lot of Rust code just reads like "names.iter().cloned().map(|name|name.trim().to_string()).filter(|name| name.is_empty()).map(|name| name.to_lowercase()).filter_map(...)" all the time.


Replies

the__alchemist • today at 2:52 AM

I've observed this too. I consider it more of a style (You did say idiomatic) or DSL than a core part of the language. I avoid it.

vor_ • today at 2:53 AM

I guess I'm used to it coming from Swift.