4 ms·
Another thing: lists of function signatures are cumbersome to read. For example: pub fn last_mut(&mut self) -> Option<&mut T> pub fn get<I>(&self, index: I) -
by b0rsuk 9y ago
Another thing: lists of function signatures are cumbersome to read. For example:
pub fn last_mut(&mut self) -> Option<&mut T>
pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>
pub fn get_mut<I>(
&mut self,
index: I
) -> Option<&mut <I as SliceIndex<[T]>>::Output>
Quite often when I program I try to read the list of operations a type implements and find one that does what I need. The list above is 3 consecutive methods from Vec documentation, and it's actually from collapsed (i.e. abridged) list. I actually cut some of that collapsed info out ("where" sections) because it's not relevant at the moment. What I'm looking for at first is "last_mut", "get", "get_mut". Now the syntax is highlighted so function names are brown, but I still have to fish out function names from that soup. The "collapse" button actually hides text description, not type information.
I find looking at the left side (table of contents) much more effective. But I never felt it was necessary when reading Python documentation.
I don't know, maybe I'm just not used to static languages.
https://doc.rust-lang.org/std/vec/struct.Vec.html https://doc.rust-lang.org/std/vec/struct.Vec.html