draco1023
5/25/2016 - 5:16 PM

with.swift

// @discardableResult to be added
// @noescape needs to move to type annotation
// needs to add _ for item
public func with<T>(item: T, @noescape update: (inout T) throws -> Void) rethrows -> T {
    var this = item; try update(&this); return this
}