3 ms·
You are not the only one. I find rust code unreadable too even though I can understand it. I wish the type signatures and function definitions were on separate
by wasifbaig 4y ago
You are not the only one. I find rust code unreadable too even though I can understand it. I wish the type signatures and function definitions were on separate lines a la Haskell. That would have drastically improved the legibility.
- ModernMech 4y agoYou can do that in Rust by using a "where" clause. Put in a letter for each type, then define them on different lines.
- estebank 4y agoAnything with trait bounds beyond `fn foo<T: Trait>(t: T)` should put them in the `where` clause (and in this case, it arguably should be `fn foo(t: impl Trait)`).