Auto-update fts index
This commit is contained in:
@@ -8,7 +8,7 @@ name = "dataset"
|
||||
#
|
||||
# working_dir = ".pile"
|
||||
|
||||
# Data sources avaliable in this dataset
|
||||
# Data sources available in this dataset
|
||||
source."music" = { type = "flac", path = ["music", "music-2"] }
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ source."music" = { type = "flac", path = ["music", "music-2"] }
|
||||
#
|
||||
# "field-name" = {
|
||||
# # The type of data this field contains.
|
||||
# # only text is supportedin this verison.
|
||||
# # only text is supported in this version.
|
||||
# type = "text",
|
||||
#
|
||||
# # An array of jsonpaths (rfc9535) used to extract this field from each source entry.
|
||||
|
||||
@@ -10,8 +10,9 @@ pub use misc::*;
|
||||
pub static INIT_DB_TOML: &str = include_str!("./config.toml");
|
||||
|
||||
#[test]
|
||||
#[expect(clippy::unwrap_used)]
|
||||
fn init_db_toml_valid() {
|
||||
toml::from_str::<ConfigToml>(INIT_DB_TOML).unwrap();
|
||||
toml::from_str::<ConfigToml>(INIT_DB_TOML).expect("INIT_DB_TOML should be valid TOML");
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Deserialize)]
|
||||
|
||||
@@ -22,7 +22,7 @@ impl<T: Debug + Clone> OneOrMany<T> {
|
||||
|
||||
pub fn as_slice(&self) -> &[T] {
|
||||
match self {
|
||||
Self::One(x) => slice::from_ref(&x),
|
||||
Self::One(x) => slice::from_ref(x),
|
||||
Self::Many(x) => &x[..],
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ impl FieldSpecPost {
|
||||
Value::Bool(_) | Value::Number(_) => Value::String(val.to_string()),
|
||||
|
||||
Value::String(x) => {
|
||||
Value::String(x.strip_suffix(trim_suffix).unwrap_or(&x).to_owned())
|
||||
Value::String(x.strip_suffix(trim_suffix).unwrap_or(x).to_owned())
|
||||
}
|
||||
|
||||
Value::Array(x) => {
|
||||
@@ -73,7 +73,7 @@ impl FieldSpecPost {
|
||||
x.iter()
|
||||
.map(|x| {
|
||||
(
|
||||
x.0.strip_suffix(trim_suffix).unwrap_or(&x.0).to_owned(),
|
||||
x.0.strip_suffix(trim_suffix).unwrap_or(x.0).to_owned(),
|
||||
self.apply(x.1),
|
||||
)
|
||||
})
|
||||
@@ -88,7 +88,7 @@ impl FieldSpecPost {
|
||||
Value::Bool(_) | Value::Number(_) => Value::String(val.to_string()),
|
||||
|
||||
Value::String(x) => {
|
||||
Value::String(x.strip_prefix(trim_prefix).unwrap_or(&x).to_owned())
|
||||
Value::String(x.strip_prefix(trim_prefix).unwrap_or(x).to_owned())
|
||||
}
|
||||
|
||||
Value::Array(x) => {
|
||||
|
||||
Reference in New Issue
Block a user