Skip to content

Commit 0b7d7e8

Browse files
authored
Fix typos
- Remove extra "is" - Add missing closing angle brackets
1 parent ad4f78f commit 0b7d7e8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

text/0135-where.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ parameter itself but rather a type that includes the type parameter.
6666

6767
#### Partially generic types
6868

69-
One situation where this is occurs is when you want to write functions
69+
One situation where this occurs is when you want to write functions
7070
where types are partially known and have those interact with other
7171
functions that are fully generic. To explain the situation, let's
7272
examine some code adapted from rustc.
@@ -83,7 +83,7 @@ value:
8383
Now, imagine I want to write some code that operates over all keys
8484
whose value is an `Option<T>` for some `T`:
8585

86-
fn example<T,K:Key<Option<T>>(table: &Table<Option<T>, K>) { ... }
86+
fn example<T,K:Key<Option<T>>>(table: &Table<Option<T>, K>) { ... }
8787

8888
This seems reasonable, but this code will not compile. The problem is
8989
that the compiler needs to know that the value type implements
@@ -98,7 +98,7 @@ There are workarounds. I might write a new trait `OptionalValue`:
9898

9999
and then I could write my example as:
100100

101-
fn example<T,O:OptionalValue<T>,K:Key<O>(table: &Table<O, K>) { ... }
101+
fn example<T,O:OptionalValue<T>,K:Key<O>>(table: &Table<O, K>) { ... }
102102

103103
But this is making my example function, already a bit complicated,
104104
become quite obscure.

0 commit comments

Comments
 (0)