From 82efc063563bbc92619168b63b1d6b16e0400aa8 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Mon, 23 Aug 2021 15:57:53 +1000 Subject: [PATCH] Update package to work with Leaf 4.0.0 --- Package.swift | 2 +- Sources/Flash/Tags/FlashTag.swift | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Package.swift b/Package.swift index 58325e8..fc829b3 100644 --- a/Package.swift +++ b/Package.swift @@ -10,7 +10,7 @@ let package = Package( .library(name: "Flash", targets: ["Flash"]), ], dependencies: [ - .package(url: "https://github.com/vapor/leaf.git", from: "4.0.0-rc"), + .package(url: "https://github.com/vapor/leaf.git", from: "4.0.0"), .package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"), ], targets: [ diff --git a/Sources/Flash/Tags/FlashTag.swift b/Sources/Flash/Tags/FlashTag.swift index 7add8a6..e088e3d 100644 --- a/Sources/Flash/Tags/FlashTag.swift +++ b/Sources/Flash/Tags/FlashTag.swift @@ -1,4 +1,5 @@ import Leaf +import LeafKit import Vapor public struct FlashTag: LeafTag { @@ -26,7 +27,6 @@ public struct FlashTag: LeafTag { } extension Collection where Element: LeafDataRepresentable { - /// Note that this is _not_ conformance to `LeafDataRepresentable`, as the return type here is non-optional. It will always produce a result. var leafData: LeafData { .array(compactMap { $0.leafData }) } @@ -39,7 +39,7 @@ extension Flash: LeafDataRepresentable { static let message = "message" } - public var leafData: LeafData? { + public var leafData: LeafData { .dictionary([ DataKey.kind: .string(kind.rawValue), DataKey.bootstrapClass: .string(kind.bootstrapClass),