This commit is contained in:
Lina Butler 2023-05-23 14:38:54 -07:00
Родитель 5de430fdb0
Коммит 1188dd2816
3 изменённых файлов: 10 добавлений и 10 удалений

Просмотреть файл

@ -15,7 +15,7 @@ use crate::{
schema::SuggestConnectionInitializer, RemoteRecordId, RemoteSuggestion, Result, Suggestion,
};
pub const LAST_FETCH_META_KEY: &'static str = "last_fetch";
pub const LAST_FETCH_META_KEY: &str = "last_fetch";
#[derive(Clone, Copy)]
pub enum ConnectionType {
@ -233,7 +233,7 @@ impl SuggestDb {
fn full_keyword(query: &str, keywords: &[impl AsRef<str>]) -> String {
let mut longer_phrase: Option<&str> = None;
let query_words_len = query.trim().split_whitespace().count();
let query_words_len = query.split_whitespace().count();
for phrase in keywords
.iter()
.filter(|phrase| phrase.as_ref().starts_with(query))

Просмотреть файл

@ -2,19 +2,19 @@
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("Error opening database: {0}")]
OpenDatabaseError(#[from] sql_support::open_database::Error),
OpenDatabase(#[from] sql_support::open_database::Error),
#[error("Error executing SQL: {0}")]
SqlError(#[from] rusqlite::Error),
Sql(#[from] rusqlite::Error),
#[error("JSON error: {0}")]
JsonError(#[from] serde_json::Error),
Json(#[from] serde_json::Error),
#[error("Error from Remote Settings: {0}")]
RemoteSettingsError(#[from] remote_settings::RemoteSettingsError),
RemoteSettings(#[from] remote_settings::RemoteSettingsError),
#[error("Operation interrupted")]
InterruptedError(#[from] interrupt_support::Interrupted),
Interrupted(#[from] interrupt_support::Interrupted),
}
#[derive(Debug, thiserror::Error)]

Просмотреть файл

@ -13,9 +13,9 @@ use crate::{
RemoteRecordId, RemoteSuggestion, Result, Suggestion,
};
const REMOTE_SETTINGS_SERVER_URL: &'static str = "https://firefox.settings.services.mozilla.com/v1";
const REMOTE_SETTINGS_DEFAULT_BUCKET: &'static str = "main";
const RS_COLLECTION: &'static str = "quicksuggest";
const REMOTE_SETTINGS_SERVER_URL: &str = "https://firefox.settings.services.mozilla.com/v1";
const REMOTE_SETTINGS_DEFAULT_BUCKET: &str = "main";
const RS_COLLECTION: &str = "quicksuggest";
/// The provider is the entry point to the Suggest component. It incrementally
/// fetches suggestions from the Remote Settings service, stores them in a local