Skip to content

Commit 35592f9

Browse files
author
cht
committed
use unwrap_or_else
1 parent a453449 commit 35592f9

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

src/subscribe/state.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,17 +120,16 @@ pub(crate) fn subscribe_state(app: &mut App) -> io::Result<IFEXIT> {
120120
}
121121

122122
KeyCode::Char('s') => {
123-
if let Err(err) = utils::create_json_file(
123+
utils::create_json_file(
124124
utils::Save::V2ray,
125125
format!(
126126
"{{
127127
\"v2core\":\"{}\"
128128
}}",
129129
app.settings_input[0]
130130
),
131-
) {
132-
panic!("{}", err);
133-
}
131+
)
132+
.unwrap_or_else(|err| panic!("{}", err));
134133
}
135134
_ => {}
136135
},

0 commit comments

Comments
 (0)