Skip to content

Commit 0ec2607

Browse files
authored
Apply suggestions from code review
1 parent 6ec99d3 commit 0ec2607

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

_posts/2025-12-11-swift-configuration-1.0-released.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ After adding a package dependency to your project, reading configuration values
3232
import Configuration
3333

3434
let config = ConfigReader(provider: EnvironmentVariablesProvider())
35-
let timeout = config.bool(forKey: "http.timeout", default: 60)
35+
let timeout = config.int(forKey: "http.timeout", default: 60)
3636
```
3737

3838
However, Swift Configuration's core strength is its ability to combine _multiple_ configuration providers into a clear, predictable hierarchy, allowing you to establish sensible defaults while providing clean override mechanisms for different deployment scenarios.
@@ -61,8 +61,8 @@ let config = ConfigReader(providers: [
6161
EnvironmentVariablesProvider(),
6262
try await FileProvider<JSONSnapshot>(filePath: "/etc/config.json")
6363
])
64-
let httpTimeout = config.int(forKey: "http.timeout", default: 60)
65-
print(httpTimeout) // 15
64+
let timeout = config.int(forKey: "http.timeout", default: 60)
65+
print(timeout) // 15
6666
```
6767

6868
Providers are checked in the order you specify: earlier providers override later ones, followed by your fallback defaults. This removes ambiguity about which configuration source is actually being used.

0 commit comments

Comments
 (0)