mirror of
https://github.com/apple/swift-collections
synced 2026-11-29 05:14:20 +00:00
Fix documentation for types conforming to ExpressibleByArrayLiteral or ExpressibleByDictionaryLiteral (#82)
This commit is contained in:
1 parent
0d73c74c9f
commit
69d4867984
4 files changed
+12
-15
No files matched your search
@@ -13,12 +13,12 @@ extension Deque: ExpressibleByArrayLiteral {
|
||||
/// Creates a new deque from the contents of an array literal.
|
||||
///
|
||||
/// Do not call this initializer directly. It is used by the compiler when
|
||||
/// you use an array literal. Instead, create a new set using an array
|
||||
/// you use an array literal. Instead, create a new deque using an array
|
||||
/// literal as its value by enclosing a comma-separated list of values in
|
||||
/// square brackets. You can use an array literal anywhere a set is expected
|
||||
/// square brackets. You can use an array literal anywhere a deque is expected
|
||||
/// by the type context.
|
||||
///
|
||||
/// - Parameter elements: A variadic list of elements of the new set.
|
||||
/// - Parameter elements: A variadic list of elements of the new deque.
|
||||
@inlinable
|
||||
@inline(__always)
|
||||
public init(arrayLiteral elements: Element...) {
|
||||
|
||||
+3
-6
@@ -13,17 +13,14 @@ extension OrderedDictionary: ExpressibleByDictionaryLiteral {
|
||||
/// Creates a new ordered dictionary from the contents of a dictionary
|
||||
/// literal.
|
||||
///
|
||||
/// Duplicate elements in the literal are allowed, but the resulting
|
||||
/// set will only contain the first occurrence of each.
|
||||
///
|
||||
/// Do not call this initializer directly. It is used by the compiler when you
|
||||
/// use a dictionary literal. Instead, create a new ordered dictionary using a
|
||||
/// dictionary literal as its value by enclosing a comma-separated list of
|
||||
/// values in square brackets. You can use an array literal anywhere a set is
|
||||
/// expected by the type context.
|
||||
/// key-value pairs in square brackets. You can use a dictionary literal
|
||||
/// anywhere an ordered dictionary is expected by the type context.
|
||||
///
|
||||
/// - Parameter elements: A variadic list of key-value pairs for the new
|
||||
/// dictionary.
|
||||
/// ordered dictionary.
|
||||
///
|
||||
/// - Complexity: O(`elements.count`) if `Key` implements
|
||||
/// high-quality hashing.
|
||||
|
||||
@@ -12,16 +12,16 @@
|
||||
extension OrderedSet: ExpressibleByArrayLiteral {
|
||||
/// Creates a new ordered set from the contents of an array literal.
|
||||
///
|
||||
/// Duplicate elements in the literal are allowed, but the resulting
|
||||
/// Duplicate elements in the literal are allowed, but the resulting ordered
|
||||
/// set will only contain the first occurrence of each.
|
||||
///
|
||||
/// Do not call this initializer directly. It is used by the compiler when
|
||||
/// you use an array literal. Instead, create a new set using an array
|
||||
/// you use an array literal. Instead, create a new ordered set using an array
|
||||
/// literal as its value by enclosing a comma-separated list of values in
|
||||
/// square brackets. You can use an array literal anywhere a set is expected
|
||||
/// by the type context.
|
||||
/// square brackets. You can use an array literal anywhere an ordered set is
|
||||
/// expected by the type context.
|
||||
///
|
||||
/// - Parameter elements: A variadic list of elements of the new set.
|
||||
/// - Parameter elements: A variadic list of elements of the new ordered set.
|
||||
///
|
||||
/// - Complexity: O(`elements.count`) if `Element` implements
|
||||
/// high-quality hashing.
|
||||
|
||||
@@ -18,7 +18,7 @@ extension Heap: ExpressibleByArrayLiteral {
|
||||
/// square brackets. You can use an array literal anywhere a heap is expected
|
||||
/// by the type context.
|
||||
///
|
||||
/// - Parameter elements: A variadic list of elements of the new set.
|
||||
/// - Parameter elements: A variadic list of elements of the new heap.
|
||||
public init(arrayLiteral elements: Element...) {
|
||||
self.init(elements)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user