Sfoglia il codice sorgente

Use indexing instead of `get` and `unwrap`

Co-authored-by: Léo Lanteri Thauvin <leseulartichaut@gmail.com>
Camelid 4 anni fa
parent
commit
e3c3985220
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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());