Skip to content

Commit 263b32a

Browse files
authored
search: ensure API types are public (#7423)
I'm working on a new UniFFI parser (mozilla/uniffi-rs#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.
1 parent 5f0f404 commit 263b32a

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

components/search/src/configuration_types.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::collections::HashMap;
1515
/// The list of possible submission methods for search engine urls.
1616
#[derive(Debug, uniffi::Enum, PartialEq, Deserialize, Clone, Default)]
1717
#[serde(rename_all = "UPPERCASE")]
18-
pub(crate) enum JSONEngineMethod {
18+
pub enum JSONEngineMethod {
1919
Post = 2,
2020
#[serde(other)]
2121
#[default]
@@ -36,7 +36,7 @@ impl JSONEngineMethod {
3636
/// configuration.
3737
#[derive(Debug, uniffi::Record, PartialEq, Deserialize, Clone, Default)]
3838
#[serde(rename_all = "camelCase")]
39-
pub(crate) struct JSONEngineUrl {
39+
pub struct JSONEngineUrl {
4040
/// The PrePath and FilePath of the URL. May include variables for engines
4141
/// which have a variable FilePath, e.g. `{searchTerms}` for when a search
4242
/// term is within the path of the url.

components/search/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub use error::SearchApiError;
1313
pub mod selector;
1414
pub mod types;
1515

16-
pub(crate) use crate::configuration_types::*;
16+
pub use crate::configuration_types::*;
1717
pub use crate::types::*;
1818
pub use selector::SearchEngineSelector;
1919
pub type SearchApiResult<T> = std::result::Result<T, error::SearchApiError>;

0 commit comments

Comments
 (0)