Bump update-informer to v1.3.0 (#16157)

# Description

This PR bumps `update-informer` to 1.3.0 and gets rid of
`NativeTlsHttpClient`.
This commit is contained in:
Grachev Mikhail
2025-07-11 20:11:12 +03:00
committed by GitHub
parent 172a0c44bd
commit f48656e18b
3 changed files with 133 additions and 36 deletions

View File

@ -6,8 +6,6 @@ use update_informer::{
registry,
};
use super::tls::tls;
#[derive(Clone)]
pub struct VersionCheck;
@ -85,30 +83,6 @@ impl Registry for NuShellNightly {
}
}
struct NativeTlsHttpClient;
impl HttpClient for NativeTlsHttpClient {
fn get<T: serde::de::DeserializeOwned>(
url: &str,
timeout: std::time::Duration,
headers: update_informer::http_client::HeaderMap,
) -> update_informer::Result<T> {
let agent = ureq::AgentBuilder::new()
.tls_connector(std::sync::Arc::new(tls(false)?))
.build();
let mut req = agent.get(url).timeout(timeout);
for (header, value) in headers {
req = req.set(header, value);
}
let json = req.call()?.into_json()?;
Ok(json)
}
}
pub fn check_for_latest_nushell_version() -> Value {
let current_version = env!("CARGO_PKG_VERSION").to_string();
@ -123,7 +97,6 @@ pub fn check_for_latest_nushell_version() -> Value {
// Since this is run on demand, there isn't really a need to cache the check.
let informer =
update_informer::new(NuShellNightly, nightly_pkg_name, current_version.clone())
.http_client(NativeTlsHttpClient)
.interval(std::time::Duration::ZERO);
if let Ok(Some(new_version)) = informer.check_version() {