Skip to content

Commit 6ce5327

Browse files
committed
Update how-to-read-rustdoc.md
1 parent afee241 commit 6ce5327

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/doc/rustdoc/src/how-to-read-rustdoc.md

+11
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,17 @@ can be matched with the following queries:
9494
* `trait:Iterator<primitive:u32> -> primitive:usize`
9595
* `Iterator -> usize`
9696

97+
Generics and function parameters are order-agnostic, but sensitive to nesting
98+
and number of matches. For example, a function with the signature
99+
`fn read_all(&mut self: impl Read) -> Result<Vec<u8>, Error>`
100+
will match these queries:
101+
102+
* `Read -> Result<Vec<u8>, Error>`
103+
* `Read -> Result<Error, Vec>`
104+
* `Read -> Result<Vec<u8>>`
105+
106+
But it *does not* match `Result<Vec, u8>` or `Result<u8<Vec>>`.
107+
97108
### Changing displayed theme
98109

99110
You can change the displayed theme by opening the settings menu (the gear

0 commit comments

Comments
 (0)