Simplify default Result generics.

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk
2025-07-08 12:08:13 +00:00
parent 8244d78cb2
commit ae707ab465
42 changed files with 95 additions and 115 deletions

View File

@@ -22,7 +22,7 @@ where
pub fn fmt<F, S>(fun: F, out: Arc<Mutex<S>>) -> Box<Closure>
where
F: Fn(&mut S, &Level, &str, &str) -> Result<()> + Send + Sync + Copy + 'static,
F: Fn(&mut S, &Level, &str, &str) -> Result + Send + Sync + Copy + 'static,
S: std::fmt::Write + Send + 'static,
{
Box::new(move |data| call(fun, &mut *out.lock().expect("locked"), &data))
@@ -30,7 +30,7 @@ where
fn call<F, S>(fun: F, out: &mut S, data: &Data<'_>)
where
F: Fn(&mut S, &Level, &str, &str) -> Result<()>,
F: Fn(&mut S, &Level, &str, &str) -> Result,
S: std::fmt::Write,
{
fun(out, &data.level(), data.span_name(), data.message()).expect("log line appended");

View File

@@ -3,7 +3,7 @@ use std::fmt::Write;
use super::{Level, color};
use crate::Result;
pub fn html<S>(out: &mut S, level: &Level, span: &str, msg: &str) -> Result<()>
pub fn html<S>(out: &mut S, level: &Level, span: &str, msg: &str) -> Result
where
S: Write + ?Sized,
{
@@ -18,7 +18,7 @@ where
Ok(())
}
pub fn markdown<S>(out: &mut S, level: &Level, span: &str, msg: &str) -> Result<()>
pub fn markdown<S>(out: &mut S, level: &Level, span: &str, msg: &str) -> Result
where
S: Write + ?Sized,
{
@@ -28,7 +28,7 @@ where
Ok(())
}
pub fn markdown_table<S>(out: &mut S, level: &Level, span: &str, msg: &str) -> Result<()>
pub fn markdown_table<S>(out: &mut S, level: &Level, span: &str, msg: &str) -> Result
where
S: Write + ?Sized,
{
@@ -38,7 +38,7 @@ where
Ok(())
}
pub fn markdown_table_head<S>(out: &mut S) -> Result<()>
pub fn markdown_table_head<S>(out: &mut S) -> Result
where
S: Write + ?Sized,
{

View File

@@ -49,7 +49,7 @@ impl LogLevelReloadHandles {
.insert(name.into(), handle);
}
pub fn reload(&self, new_value: &EnvFilter, names: Option<&[&str]>) -> Result<()> {
pub fn reload(&self, new_value: &EnvFilter, names: Option<&[&str]>) -> Result {
self.handles
.lock()
.expect("locked")