about summary refs log tree commit diff
path: root/src/indieauth/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/indieauth/mod.rs')
-rw-r--r--src/indieauth/mod.rs16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/indieauth/mod.rs b/src/indieauth/mod.rs
index 811bec6..26879bb 100644
--- a/src/indieauth/mod.rs
+++ b/src/indieauth/mod.rs
@@ -176,12 +176,18 @@ async fn authorization_endpoint_get<A: AuthBackend, D: Storage + 'static>(
                                 .into_response()
                         }
 
-                        mf2.items.iter()
+                        mf2.items
+                            .iter()
+                            .find(|&i| (**i).borrow().r#type.iter()
+                                .any(|i| {
+                                    *i == Class::from_str("h-app").unwrap()
+                                        || *i == Class::from_str("h-x-app").unwrap()
+                                })
+                            )
                             .cloned()
-                            .find(|i| (**i).borrow().r#type.iter()
-                                  .any(|i| *i == microformats::types::Class::from_str("h-app").unwrap()
-                                       || *i == microformats::types::Class::from_str("h-x-app").unwrap()))
-                            .map(|i| serde_json::to_value(i.borrow().deref()).unwrap())
+                            .map(|i| {
+                                serde_json::to_value(i.borrow().deref()).unwrap()
+                            })
                     },
                     Err(err) => {
                         tracing::error!("Error parsing application metadata: {}", err);