One element tuple
- We can create a one-element tuple by putting a comma after the element, but probably there is not much value in it.
- It is better to just create a variable holding that single value.
examples/tuples/one-element/src/main.rs
fn main() { let thing = ("text",); println!("{:?}", thing); println!("{}", thing.0); let thing = "text"; println!("{}", thing); }
("text",) text text