Skip to content

Commit 3306916

Browse files
JessyCatterwaulrayfix
authored andcommitted
Issue kodecocodes#240 (generic example) (kodecocodes#255)
* Use `swap` for single uppercase letter generic parameter example (kodecocodes#240) * Add Jessy Catterwaul to the credits
1 parent f9f203a commit 3306916

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CREDITS.markdown

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ It is a collaborative effort from the most stylish raywenderlich.com team member
66
* [Jawwad Ahmad](https://github.com/jawwad)
77
* [Soheil Moayedi Azarpour](https://github.com/moayes)
88
* [Scott Berrevoets](https://github.com/Scott90)
9+
* [Jessy Catterwaul](https://github.com/JessyCatterwaul)
910
* [Eric Cerney](https://github.com/ecerney)
1011
* [Sam Davies](https://github.com/sammyd)
1112
* [Evan Dekhayser](https://github.com/edekhayser)

README.markdown

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,14 @@ Generic type parameters should be descriptive, upper camel case names. When a ty
152152
```swift
153153
struct Stack<Element> { ... }
154154
func write<Target: OutputStream>(to target: inout Target)
155-
func max<T: Comparable>(_ x: T, _ y: T) -> T
155+
func swap<T>(_ a: inout T, _ b: inout T)
156156
```
157157

158158
**Not Preferred:**
159159
```swift
160160
struct Stack<T> { ... }
161161
func write<target: OutputStream>(to target: inout target)
162-
func max<Thing: Comparable>(_ x: Thing, _ y: Thing) -> Thing
162+
func swap<Thing>(_ a: inout Thing, _ b: inout Thing)
163163
```
164164

165165
### Language

0 commit comments

Comments
 (0)