Skip to content

Commit

Permalink
chore: fix tantivy dependency due to upstream rev missing
Browse files Browse the repository at this point in the history
  • Loading branch information
wsxiaoys committed May 29, 2024
1 parent e7af21a commit de68fbe
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 25 deletions.
20 changes: 10 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ tracing = "0.1"
tokio-cron-scheduler = "0.9.4"
tracing-subscriber = "0.3"
anyhow = "1.0.71"
tantivy = { git = "https://github.com/quickwit-oss/tantivy", rev = "b806122" }
tantivy = { git = "https://github.com/wsxiaoys/tantivy", rev = "442a7b3" }
async-trait = "0.1.72"
reqwest = { version = "0.12" }
derive_builder = "0.12.0"
Expand Down
18 changes: 9 additions & 9 deletions crates/tabby/src/services/code.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use tabby_common::{
};
use tantivy::{
collector::{Count, TopDocs},
schema::{self, document::ReferenceValue, Value},
schema::{self, Value},
IndexReader, TantivyDocument,
};
use tokio::sync::Mutex;
Expand Down Expand Up @@ -125,10 +125,10 @@ fn get_text(doc: &TantivyDocument, field: schema::Field) -> &str {
}

fn get_json_number_field(doc: &TantivyDocument, field: schema::Field, name: &str) -> i64 {
let ReferenceValue::Object(obj) = doc.get_first(field).unwrap() else {
panic!("Field {} is not an object", name);
};
obj.into_iter()
doc.get_first(field)
.unwrap()
.as_object()
.unwrap()

Check warning on line 131 in crates/tabby/src/services/code.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/services/code.rs#L128-L131

Added lines #L128 - L131 were not covered by tests
.find(|(k, _)| *k == name)
.unwrap()
.1
Expand All @@ -137,10 +137,10 @@ fn get_json_number_field(doc: &TantivyDocument, field: schema::Field, name: &str
}

fn get_json_text_field<'a>(doc: &'a TantivyDocument, field: schema::Field, name: &str) -> &'a str {
let ReferenceValue::Object(obj) = doc.get_first(field).unwrap() else {
panic!("Field {} is not an object", name);
};
obj.into_iter()
doc.get_first(field)
.unwrap()
.as_object()
.unwrap()

Check warning on line 143 in crates/tabby/src/services/code.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/services/code.rs#L140-L143

Added lines #L140 - L143 were not covered by tests
.find(|(k, _)| *k == name)
.unwrap()
.1
Expand Down
10 changes: 5 additions & 5 deletions crates/tabby/src/services/doc/tantivy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tabby_common::{
use tabby_inference::Embedding;
use tantivy::{
collector::TopDocs,
schema::{self, document::ReferenceValue, Value},
schema::{self, Value},
IndexReader, TantivyDocument,
};
use tracing::warn;
Expand Down Expand Up @@ -87,10 +87,10 @@ fn get_text(doc: &TantivyDocument, field: schema::Field) -> &str {
}

fn get_json_text_field<'a>(doc: &'a TantivyDocument, field: schema::Field, name: &str) -> &'a str {
let ReferenceValue::Object(obj) = doc.get_first(field).unwrap() else {
panic!("Field {} is not an object", name);
};
obj.into_iter()
doc.get_first(field)
.unwrap()
.as_object()
.unwrap()

Check warning on line 93 in crates/tabby/src/services/doc/tantivy.rs

View check run for this annotation

Codecov / codecov/patch

crates/tabby/src/services/doc/tantivy.rs#L90-L93

Added lines #L90 - L93 were not covered by tests
.find(|(k, _)| *k == name)
.unwrap()
.1
Expand Down

0 comments on commit de68fbe

Please sign in to comment.