remove dependency on nightly
This commit is contained in:
parent
cae88a20ff
commit
bf4db99465
1
Cargo.lock
generated
1
Cargo.lock
generated
@ -937,6 +937,7 @@ dependencies = [
|
||||
"fend-core",
|
||||
"futures",
|
||||
"html-escape",
|
||||
"once_cell",
|
||||
"rand",
|
||||
"regex",
|
||||
"reqwest",
|
||||
|
@ -23,6 +23,7 @@ eyre = "0.6.11"
|
||||
fend-core = "1.3.3"
|
||||
futures = "0.3.29"
|
||||
html-escape = "0.2.13"
|
||||
once_cell = "1.19.0"
|
||||
rand = "0.8.5"
|
||||
regex = "1.10.2"
|
||||
reqwest = { version = "0.11.23", default-features = false, features = [
|
||||
|
@ -1,6 +1,7 @@
|
||||
use std::{cell::Cell, sync::LazyLock};
|
||||
use std::cell::Cell;
|
||||
|
||||
use fend_core::SpanKind;
|
||||
use once_cell::sync::Lazy;
|
||||
|
||||
use crate::engines::EngineResponse;
|
||||
|
||||
@ -96,7 +97,7 @@ fn evaluate(query: &str, html: bool) -> Option<String> {
|
||||
Some(result_html)
|
||||
}
|
||||
|
||||
pub static FEND_CONTEXT: LazyLock<fend_core::Context> = LazyLock::new(|| {
|
||||
pub static FEND_CONTEXT: Lazy<fend_core::Context> = Lazy::new(|| {
|
||||
let mut context = fend_core::Context::new();
|
||||
|
||||
// make lowercase f and c work
|
||||
|
@ -4,11 +4,11 @@ use std::{
|
||||
net::IpAddr,
|
||||
ops::Deref,
|
||||
str::FromStr,
|
||||
sync::LazyLock,
|
||||
time::Instant,
|
||||
};
|
||||
|
||||
use futures::future::join_all;
|
||||
use once_cell::sync::Lazy;
|
||||
use reqwest::header::HeaderMap;
|
||||
use tokio::sync::mpsc;
|
||||
|
||||
@ -400,7 +400,7 @@ pub async fn autocomplete_with_engines(
|
||||
Ok(merge_autocomplete_responses(autocomplete_results))
|
||||
}
|
||||
|
||||
pub static CLIENT: LazyLock<reqwest::Client> = LazyLock::new(|| {
|
||||
pub static CLIENT: Lazy<reqwest::Client> = Lazy::new(|| {
|
||||
reqwest::ClientBuilder::new()
|
||||
.local_address(IpAddr::from_str("0.0.0.0").unwrap())
|
||||
// we pretend to be a normal browser so websites don't block us
|
||||
|
@ -48,7 +48,7 @@ pub fn parse_response(body: &str) -> Option<String> {
|
||||
.url_relative(ammonia::UrlRelative::RewriteWithBase(
|
||||
Url::parse("https://github.com").unwrap(),
|
||||
))
|
||||
.clean(&readme_html)
|
||||
.clean(readme_html)
|
||||
.to_string();
|
||||
|
||||
let readme_dom = Html::parse_fragment(&readme_html);
|
||||
|
@ -19,7 +19,7 @@ pub fn request(query: &str) -> RequestResponse {
|
||||
"https://search.marginalia.nu/search",
|
||||
&[
|
||||
("query", query),
|
||||
("profile", "default"),
|
||||
("profile", "corpo"),
|
||||
("js", "default"),
|
||||
("adtech", "default"),
|
||||
],
|
||||
|
@ -1,5 +1,3 @@
|
||||
#![feature(lazy_cell)]
|
||||
|
||||
pub mod engines;
|
||||
pub mod normalize;
|
||||
pub mod parse;
|
||||
|
Loading…
Reference in New Issue
Block a user