Why and when should a comma be used at the end of a block?
问题 There many cases in Rust when a block of code can end with or without comma. For example: enum WithoutComma { x, y } or enum WithComma { x, y, } There are also other examples with match , etc. It seems that both variants lead to the same result. The only case I know where adding or removing a comma changes behaviour is the 1-element tuple declaration (which isn't a block): let just_int = (5); let tuple = (5,); Why can one use a comma or not at the end of a block? Why is there such dualism in