therealbnut / Expressible

Make it easier to conform to Swift Expressible protocols

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Expressible

Make it easier to conform to Swift Standard Library Protocols

Do this

extension MyType: ExpressibleByStringLiteral {
    public init(stringLiteral value: String) {
        self.init(string: value)
    }
}

Not this

extension MyType: ExpressibleByStringLiteral {
    public init(stringLiteral value: String) {
        self.init(string: value)
    }
    
    public init(extendedGraphemeClusterLiteral value: StringLiteralType) {
        self.init(string: value)
    }
    
    public init(unicodeScalarLiteral value: ExtendedGraphemeClusterLiteralType) {
        self.init(string: value)
    }
}

About

Make it easier to conform to Swift Expressible protocols

License:MIT License


Languages

Language:Swift 100.0%