Skip to content

Commit bb22846

Browse files
committed
Use control flow operator instead of unwrap
1 parent 8455487 commit bb22846

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

mcmeta/src/app_config.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,9 @@ impl ServerConfig {
1919
pub fn from_config() -> Result<Self, MetaMCError> {
2020
let config = config::Config::builder()
2121
.add_source(config::Environment::with_prefix("MCMETA"))
22-
.set_default("bind_address", "127.0.0.1:8080")
23-
.unwrap()
24-
.set_default("storage_format", "json")
25-
.unwrap()
26-
.set_default("meta_directory", "meta")
27-
.unwrap()
22+
.set_default("bind_address", "127.0.0.1:8080")?
23+
.set_default("storage_format", "json")?
24+
.set_default("meta_directory", "meta")?
2825
.build()?;
2926

3027
config.try_deserialize::<'_, Self>().map_err(Into::into)

0 commit comments

Comments
 (0)