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:
Matt Massicotte authored and GitHub committed 2026-11-03 10:14:16 +00:00
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() ?? [:]