Skip to content

Commit

Permalink
make literals use content representable
Browse files Browse the repository at this point in the history
  • Loading branch information
paulofaria committed May 17, 2017
1 parent 2b9cdb6 commit c4f0037
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Sources/Core/Content/Content.swift
Original file line number Diff line number Diff line change
Expand Up @@ -243,18 +243,18 @@ extension Content : ExpressibleByStringLiteral {

extension Content : ExpressibleByArrayLiteral {
/// :nodoc:
public init(arrayLiteral elements: Content...) {
self = .array(elements)
public init(arrayLiteral elements: ContentRepresentable...) {
self = .array(elements.map({ $0.content }))
}
}

extension Content : ExpressibleByDictionaryLiteral {
/// :nodoc:
public init(dictionaryLiteral elements: (String, Content)...) {
public init(dictionaryLiteral elements: (String, ContentRepresentable)...) {
var dictionary = [String: Content](minimumCapacity: elements.count)

for (key, value) in elements {
dictionary[key] = value
dictionary[key] = value.content
}

self = .dictionary(dictionary)
Expand Down

0 comments on commit c4f0037

Please sign in to comment.