[Bugifx] Lossy codable list documentation (#20)

This PR contains the work done to amend some documentation in the `LossyCodableList` struct.

Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Reviewed-on: #20
This commit is contained in:
Javier Cicchelli 2023-05-07 20:01:05 +00:00
parent 28c9232962
commit 5286f72f05

View File

@ -10,8 +10,10 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
/// This struct (that could also be used as a property wrapper as well) provides a generic type that acts as a thin wrapper around an array of `Elements` instances to allow a lossy decoding and or encoding process.
///
/// This implementation is heavily influenced by this [article](https://www.swiftbysundell.com/articles/ignoring-invalid-json-elements-codable/).
@propertyWrapper @propertyWrapper
/// This property wrapper provides a generic type that acts as a thin wrapper around an array of `Elements` instances to allow a lossy decoding and or encoding process.
public struct LossyCodableList<Element> { public struct LossyCodableList<Element> {
// MARK: Properties // MARK: Properties
@ -26,7 +28,7 @@ public struct LossyCodableList<Element> {
// MARK: Initialisers // MARK: Initialisers
/// Initialises this property wrapper. /// Initialises this struct.
public init() { public init() {
self.elements = [] self.elements = []
} }