Skip to content

Commit 459be81

Browse files
committed
easier err bounds for exporter
1 parent a4ff84f commit 459be81

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "logicline"
3-
version = "0.1.2"
3+
version = "0.1.3"
44
edition = "2021"
55
authors = ["Serhij S. <div@altertech.com>"]
66
license = "Apache-2.0"

src/lib.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,15 +70,15 @@ pub mod global {
7070

7171
/// Installs the exporter (HTTP server) on the default address (all interfaces, 9001)
7272
#[cfg(feature = "exporter")]
73-
pub fn install_exporter() -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
73+
pub fn install_exporter() -> Result<(), Box<dyn std::error::Error>> {
7474
install_exporter_on((IpAddr::from([0, 0, 0, 0]), DEFAULT_PORT))
7575
}
7676

7777
/// Installs the exporter (HTTP server) on the specified address
7878
#[cfg(feature = "exporter")]
7979
pub fn install_exporter_on<A: ToSocketAddrs>(
8080
addr: A,
81-
) -> Result<(), Box<dyn std::error::Error + Send + Sync + 'static>> {
81+
) -> Result<(), Box<dyn std::error::Error>> {
8282
let server = rouille::Server::new(addr, move |request| {
8383
if request.method() != "GET" {
8484
return rouille::Response::empty_406();
@@ -94,7 +94,8 @@ pub mod global {
9494
return rouille::Response::html(include_str!("../ll-default-view/dist/index.html"));
9595
}
9696
rouille::Response::empty_404()
97-
})?;
97+
})
98+
.map_err(|e| e.to_string())?;
9899
std::thread::Builder::new()
99100
.name("exporter".to_string())
100101
.spawn(move || {

0 commit comments

Comments
 (0)