I’m glad my points we’re helpful!
There is some documentation on examples in the Cargo book. The basic procedure is to put it in an examples
directory alongside the src
directory (and in its own subfolder if it has multiple files), and you can add an entry for it in the Cargo.toml
(although it should automatically detect it if you put it in the examples
directory, so that is only strictly necessary if you want to change the default settings).
I think the point being made is that the layout shown only applies for
Sized
T
. Layouts for&[T]
and&dyn Trait
are shown elsewhere on the sheet.&str
is noted under&[T]
.Edit: although, similar considerations would apply to other pointer types, but that isn’t noted on the sheet except for
Box<[T]>