Skip to content

Commit

Permalink
Merge pull request #22 from JaSpa/master
Browse files Browse the repository at this point in the history
Mark mapping closures `@noescape`
  • Loading branch information
robrix committed Apr 19, 2015
2 parents 18d05a5 + 85e19e8 commit a2c22dd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Box/Box.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public final class Box<T>: BoxType, Printable {
public let value: T

/// Constructs a new Box by transforming `value` by `f`.
public func map<U>(f: T -> U) -> Box<U> {
public func map<U>(@noescape f: T -> U) -> Box<U> {
return Box<U>(f(value))
}

Expand Down
2 changes: 1 addition & 1 deletion Box/BoxType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,6 @@ public func != <B: BoxType where B.Value: Equatable> (lhs: B, rhs: B) -> Bool {
// MARK: Map

/// Maps the value of a box into a new box.
public func map<B: BoxType, C: BoxType>(v: B, f: B.Value -> C.Value) -> C {
public func map<B: BoxType, C: BoxType>(v: B, @noescape f: B.Value -> C.Value) -> C {
return C(f(v.value))
}
2 changes: 1 addition & 1 deletion Box/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.2.0</string>
<string>1.2.1</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
2 changes: 1 addition & 1 deletion Box/MutableBox.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public final class MutableBox<T>: MutableBoxType, Printable {
public var value: T

/// Constructs a new MutableBox by transforming `value` by `f`.
public func map<U>(f: T -> U) -> MutableBox<U> {
public func map<U>(@noescape f: T -> U) -> MutableBox<U> {
return MutableBox<U>(f(value))
}

Expand Down

0 comments on commit a2c22dd

Please sign in to comment.