Explorar o código

Use indexing instead of `get` and `unwrap`

Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
Camelid %!s(int64=4) %!d(string=hai) anos
pai
achega
e3c3985220
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      src/handlers/notify_zulip.rs

+ 1 - 1
src/handlers/notify_zulip.rs

@@ -135,7 +135,7 @@ pub(super) async fn handle_input<'a>(
     inputs: Vec<NotifyZulipInput>,
 ) -> anyhow::Result<()> {
     for input in inputs {
-        let config = config.labels.get(&input.label.name).unwrap();
+        let config = &config.labels[&input.label.name];
 
         let mut topic = config.topic.clone();
         topic = topic.replace("{number}", &event.issue.number.to_string());