From aa6bbfc2d43866f0f025a77e1a90ebf14b858a88 Mon Sep 17 00:00:00 2001 From: Ben Dean-Kawamura Date: Fri, 5 Jun 2026 09:29:38 -0400 Subject: [PATCH] search: ensure API types are public I'm working on a new UniFFI parser (https://github.com/mozilla/uniffi-rs/pull/2841) and it currently requires that types used in the exported functions are publicly available from other crates. I could maybe rework the parser to handle this another way, but this feels cleaner to me anyways. It feels weird if a type can be used by foreign languages but not other Rust crates. --- components/search/src/configuration_types.rs | 4 ++-- components/search/src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/components/search/src/configuration_types.rs b/components/search/src/configuration_types.rs index 001dc303ec..3c564de007 100644 --- a/components/search/src/configuration_types.rs +++ b/components/search/src/configuration_types.rs @@ -15,7 +15,7 @@ use std::collections::HashMap; /// The list of possible submission methods for search engine urls. #[derive(Debug, uniffi::Enum, PartialEq, Deserialize, Clone, Default)] #[serde(rename_all = "UPPERCASE")] -pub(crate) enum JSONEngineMethod { +pub enum JSONEngineMethod { Post = 2, #[serde(other)] #[default] @@ -36,7 +36,7 @@ impl JSONEngineMethod { /// configuration. #[derive(Debug, uniffi::Record, PartialEq, Deserialize, Clone, Default)] #[serde(rename_all = "camelCase")] -pub(crate) struct JSONEngineUrl { +pub struct JSONEngineUrl { /// The PrePath and FilePath of the URL. May include variables for engines /// which have a variable FilePath, e.g. `{searchTerms}` for when a search /// term is within the path of the url. diff --git a/components/search/src/lib.rs b/components/search/src/lib.rs index b338b8435a..a2353e143a 100644 --- a/components/search/src/lib.rs +++ b/components/search/src/lib.rs @@ -13,7 +13,7 @@ pub use error::SearchApiError; pub mod selector; pub mod types; -pub(crate) use crate::configuration_types::*; +pub use crate::configuration_types::*; pub use crate::types::*; pub use selector::SearchEngineSelector; pub type SearchApiResult = std::result::Result;