diff --git a/src/lib.rs b/src/lib.rs index 855a897..1160337 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -31,8 +31,10 @@ impl Query { .read() .await .to_vec(); - let idx = tbls.binary_search_by(|t| t.name.cmp(&name)).unwrap(); - Ok(Some(tbls[idx].clone())) + match tbls.binary_search_by(|t| t.name.cmp(&name)) { + Ok(idx) => Ok(Some(tbls[idx].clone())), + Err(_) => Ok(None), + } } async fn tables(&self, ctx: &Context<'_>) -> Vec