mirror of
https://github.com/apple/swift-log
synced 2026-11-22 03:40:39 +00:00
Remove unnecessary optional so example compiles (#501)
There's an unnecessary optional return here that prevents the example from compiling. ### Motivation: It took me a moment to figure out how to fix this, but in the end it was very straightforward. The `prepareMetadata` doesn't ever need to return nil. ### Modifications: A small type change fixes the compilation errors in `log(event:)` ### Result: The example in the documentation can now be used unmodified.
This commit is contained in:
1 parent
c44b210eee
commit
209524e4da
1 file changed
+1
-1
@@ -287,7 +287,7 @@ public struct PrintLogHandler: LogHandler {
|
||||
base: Logger.Metadata,
|
||||
provider: Logger.MetadataProvider?,
|
||||
explicit: Logger.Metadata?
|
||||
) -> Logger.Metadata? {
|
||||
) -> Logger.Metadata {
|
||||
var metadata = base
|
||||
|
||||
let provided = provider?.get() ?? [:]
|
||||
|
||||
Reference in new issue
Block a user