mirror of https://github.com/rust-lang/nomicon
The main issue with having three lets one after the other, is that it's not clear if the lifetime created due to `let x` is the one before or after this line. Assuming I understood correctly what's going on, this example will clarify that the lifetime is created after the let. I also add a note stating what the usual notation is and warning that this longer explicit lifetime name is used only once for the sake of being as clear as possible. Other solutions I considered would be to add a "print" between two lets, this will ensure that the lifetime introduction is near a single "let", hence making it clear which "let" is concerned by the lifetime. If I got it wrong and actually the scope is introduced before the let statement, I guess at least this confirms that clarification may be helpful.pull/351/head
parent
c7d8467ca9
commit
6dbf905b6d
Loading…
Reference in new issue