Simplify default Result generics.
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
@@ -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");
|
||||
|
||||
@@ -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,
|
||||
{
|
||||
|
||||
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user