Skip to content

Commit 08206f5

Browse files
authored
Docs: Update KeyMappingProvider example to use prefixKeys(with:) (#125)
### Motivation The documentation example was using a manual `mapKeys` closure instead of the more concise `prefixKeys(with:)` convenience method provided by the library. ### Modifications Updated the code snippet in KeyMappingProvider.swift to use the `prefixKeys(with:)` method. ### Result The documentation example now correctly reflects the recommended and most concise way to prefix keys. ### Test Plan Documentation-only change. Verified the syntax in the code comment.
1 parent 18cc717 commit 08206f5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

Sources/Configuration/Providers/Wrappers/KeyMappingProvider.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@
5757
///
5858
/// ```swift
5959
/// let envProvider = EnvironmentVariablesProvider()
60-
/// let keyMappedEnvProvider = envProvider.mapKeys { key in
61-
/// key.prepending(["myapp", "prod"])
62-
/// }
60+
/// let keyMappedEnvProvider = envProvider.prefixKeys(with: ["myapp", "prod"])
6361
/// ```
6462
@available(Configuration 1.0, *)
6563
public struct KeyMappingProvider<Upstream: ConfigProvider>: Sendable {

0 commit comments

Comments
 (0)