From 605b98276d895e8587288e46dbc5c29493a7a0e2 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 25 Aug 2019 10:37:20 +0200 Subject: Run "cargo fix --all-features" in root of project Signed-off-by: Matthias Beyer --- bin/core/imag-ids/src/main.rs | 4 +-- bin/domain/imag-contact/src/create.rs | 6 ++-- bin/domain/imag-contact/src/edit.rs | 2 +- bin/domain/imag-log/src/main.rs | 2 +- lib/core/libimagstore/src/file_abstraction/fs.rs | 6 ++-- .../libimagstore/src/file_abstraction/inmemory.rs | 6 ++-- lib/core/libimagstore/src/file_abstraction/iter.rs | 14 +++++----- lib/core/libimagstore/src/file_abstraction/mod.rs | 4 +-- lib/core/libimagstore/src/iter.rs | 4 +-- lib/core/libimagstore/src/store.rs | 10 +++---- lib/core/libimagstore/src/storeid.rs | 6 ++-- lib/domain/libimagtimetrack/src/iter/tag.rs | 4 +-- lib/entry/libimagentrycategory/src/entry.rs | 4 +-- lib/etc/libimaginteraction/src/ask.rs | 6 ++-- lib/etc/libimaginteraction/src/format.rs | 32 +++++++++++----------- 15 files changed, 55 insertions(+), 55 deletions(-) diff --git a/bin/core/imag-ids/src/main.rs b/bin/core/imag-ids/src/main.rs index 29c16e73..8c8222bd 100644 --- a/bin/core/imag-ids/src/main.rs +++ b/bin/core/imag-ids/src/main.rs @@ -79,10 +79,10 @@ fn main() { ::std::process::exit(1); }); Box::new(ids.into_iter().map(Ok)) - as Box>> + as Box>> } else { Box::new(rt.store().entries().map_err_trace_exit_unwrap()) - as Box>> + as Box>> } .trace_unwrap_exit() .map(|id| if print_storepath { diff --git a/bin/domain/imag-contact/src/create.rs b/bin/domain/imag-contact/src/create.rs index 4144279e..6176aba0 100644 --- a/bin/domain/imag-contact/src/create.rs +++ b/bin/domain/imag-contact/src/create.rs @@ -76,7 +76,7 @@ mod test { } } -fn ask_continue(inputstream: &mut Read, outputstream: &mut Write) -> bool { +fn ask_continue(inputstream: &mut dyn Read, outputstream: &mut dyn Write) -> bool { ::libimaginteraction::ask::ask_bool("Edit tempfile", Some(true), inputstream, outputstream) .map_err_trace_exit_unwrap() } @@ -97,7 +97,7 @@ pub fn create(rt: &Runtime) { .map_err_trace_exit_unwrap(); // TODO: Refactor the above to libimagutil or libimagrt? - let (mut dest, location, uuid) : (Box, Option, String) = { + let (mut dest, location, uuid) : (Box, Option, String) = { if let Some(mut fl) = scmd.value_of("file-location").map(PathBuf::from) { let uuid = if fl.is_file() { error!("File does exist, cannot create/override"); @@ -232,7 +232,7 @@ pub fn create(rt: &Runtime) { info!("Ready"); } -fn parse_toml_into_vcard(output: &mut Write, input: &mut Read, toml: Value, uuid: String) -> Option { +fn parse_toml_into_vcard(output: &mut dyn Write, input: &mut dyn Read, toml: Value, uuid: String) -> Option { let mut vcard = VcardBuilder::new().with_uid(uuid); { // parse name diff --git a/bin/domain/imag-contact/src/edit.rs b/bin/domain/imag-contact/src/edit.rs index 1c7a2ae6..4de4da00 100644 --- a/bin/domain/imag-contact/src/edit.rs +++ b/bin/domain/imag-contact/src/edit.rs @@ -113,7 +113,7 @@ fn edit_contact<'a>(rt: &Runtime, contact: &FileLockEntry<'a>, ref_config: &RefC .map(|_| ()) } -fn ask_continue(inputstream: &mut Read, outputstream: &mut Write) -> bool { +fn ask_continue(inputstream: &mut dyn Read, outputstream: &mut dyn Write) -> bool { ::libimaginteraction::ask::ask_bool("Edit vcard", Some(true), inputstream, outputstream) .map_err_trace_exit_unwrap() } diff --git a/bin/domain/imag-log/src/main.rs b/bin/domain/imag-log/src/main.rs index 5edfb5ba..5c106c99 100644 --- a/bin/domain/imag-log/src/main.rs +++ b/bin/domain/imag-log/src/main.rs @@ -266,7 +266,7 @@ fn get_log_text(rt: &Runtime) -> String { }) } -fn do_write_to<'a>(sink: &mut Write, id: DiaryId, entry: &FileLockEntry<'a>, do_remove_newlines: bool) -> RResult<(), ExitCode> { +fn do_write_to<'a>(sink: &mut dyn Write, id: DiaryId, entry: &FileLockEntry<'a>, do_remove_newlines: bool) -> RResult<(), ExitCode> { let text = if do_remove_newlines { entry.get_content().trim_end().replace("\n", "") } else { diff --git a/lib/core/libimagstore/src/file_abstraction/fs.rs b/lib/core/libimagstore/src/file_abstraction/fs.rs index a14628cb..f885fff5 100644 --- a/lib/core/libimagstore/src/file_abstraction/fs.rs +++ b/lib/core/libimagstore/src/file_abstraction/fs.rs @@ -136,7 +136,7 @@ impl FileAbstraction for FSFileAbstraction { Ok(path.is_file()) } - fn new_instance(&self, p: PathBuf) -> Box { + fn new_instance(&self, p: PathBuf) -> Box { Box::new(FSFileAbstractionInstance(p)) } @@ -156,7 +156,7 @@ impl FileAbstraction for FSFileAbstraction { fn pathes_recursively<'a>(&self, basepath: PathBuf, storepath: &'a PathBuf, - backend: Arc) + backend: Arc) -> Result> { trace!("Building PathIterator object"); @@ -170,7 +170,7 @@ pub struct WalkDirPathIterBuilder { } impl PathIterBuilder for WalkDirPathIterBuilder { - fn build_iter(&self) -> Box>> { + fn build_iter(&self) -> Box>> { trace!("Building iterator for {}", self.basepath.display()); Box::new(WalkDir::new(self.basepath.clone()) .min_depth(1) diff --git a/lib/core/libimagstore/src/file_abstraction/inmemory.rs b/lib/core/libimagstore/src/file_abstraction/inmemory.rs index d1a47acb..711203c6 100644 --- a/lib/core/libimagstore/src/file_abstraction/inmemory.rs +++ b/lib/core/libimagstore/src/file_abstraction/inmemory.rs @@ -164,7 +164,7 @@ impl FileAbstraction for InMemoryFileAbstraction { self.exists(pb) } - fn new_instance(&self, p: PathBuf) -> Box { + fn new_instance(&self, p: PathBuf) -> Box { Box::new(InMemoryFileAbstractionInstance::new(self.backend().clone(), p)) } @@ -187,7 +187,7 @@ impl FileAbstraction for InMemoryFileAbstraction { Ok(()) } - fn pathes_recursively<'a>(&self, _basepath: PathBuf, storepath: &'a PathBuf, backend: Arc) -> Result> { + fn pathes_recursively<'a>(&self, _basepath: PathBuf, storepath: &'a PathBuf, backend: Arc) -> Result> { trace!("Building PathIterator object (inmemory implementation)"); let keys : Vec = self .backend() @@ -207,7 +207,7 @@ impl FileAbstraction for InMemoryFileAbstraction { pub struct InMemPathIterBuilder(Vec); impl PathIterBuilder for InMemPathIterBuilder { - fn build_iter(&self) -> Box>> { + fn build_iter(&self) -> Box>> { Box::new(self.0.clone().into_iter().map(Ok)) } diff --git a/lib/core/libimagstore/src/file_abstraction/iter.rs b/lib/core/libimagstore/src/file_abstraction/iter.rs index 0fb232bc..a0d1715b 100644 --- a/lib/core/libimagstore/src/file_abstraction/iter.rs +++ b/lib/core/libimagstore/src/file_abstraction/iter.rs @@ -28,7 +28,7 @@ use crate::file_abstraction::FileAbstraction; /// See documentation for PathIterator pub(crate) trait PathIterBuilder : Debug { - fn build_iter(&self) -> Box>>; + fn build_iter(&self) -> Box>>; fn in_collection(&mut self, c: &str) -> Result<()>; } @@ -47,17 +47,17 @@ pub(crate) trait PathIterBuilder : Debug { /// This means quite a few allocations down the road, as the PathIterator itself is not generic, but /// this seems to be the best way to implement this. pub(crate) struct PathIterator<'a> { - iter_builder: Box, - iter: Box>>, + iter_builder: Box, + iter: Box>>, storepath: &'a PathBuf, - backend: Arc, + backend: Arc, } impl<'a> PathIterator<'a> { - pub fn new(iter_builder: Box, + pub fn new(iter_builder: Box, storepath: &'a PathBuf, - backend: Arc) + backend: Arc) -> PathIterator<'a> { trace!("Generating iterator object with PathIterBuilder: {:?}", iter_builder); @@ -81,7 +81,7 @@ impl<'a> PathIterator<'a> { /// /// Revisit whether this can be done in a cleaner way. See commit message for why this is /// needed. - pub(crate) fn into_inner(self) -> Box>> { + pub(crate) fn into_inner(self) -> Box>> { self.iter } diff --git a/lib/core/libimagstore/src/file_abstraction/mod.rs b/lib/core/libimagstore/src/file_abstraction/mod.rs index a8fbf403..90df288a 100644 --- a/lib/core/libimagstore/src/file_abstraction/mod.rs +++ b/lib/core/libimagstore/src/file_abstraction/mod.rs @@ -43,12 +43,12 @@ pub(crate) trait FileAbstraction : Debug { fn exists(&self, _: &PathBuf) -> Result; fn is_file(&self, _: &PathBuf) -> Result; - fn new_instance(&self, p: PathBuf) -> Box; + fn new_instance(&self, p: PathBuf) -> Box; fn drain(&self) -> Result; fn fill<'a>(&'a mut self, d: Drain) -> Result<()>; - fn pathes_recursively<'a>(&self, basepath: PathBuf, storepath: &'a PathBuf, backend: Arc) -> Result>; + fn pathes_recursively<'a>(&self, basepath: PathBuf, storepath: &'a PathBuf, backend: Arc) -> Result>; } /// An abstraction trait over actions on files diff --git a/lib/core/libimagstore/src/iter.rs b/lib/core/libimagstore/src/iter.rs index 6594579f..1c80d160 100644 --- a/lib/core/libimagstore/src/iter.rs +++ b/lib/core/libimagstore/src/iter.rs @@ -33,11 +33,11 @@ macro_rules! mk_iterator_mod { use crate::store::Store; use failure::Fallible as Result; - pub struct $itername<'a>(Box> + 'a>, &'a Store); + pub struct $itername<'a>(Box> + 'a>, &'a Store); impl<'a> $itername<'a> { - pub fn new(inner: Box> + 'a>, store: &'a Store) -> Self { + pub fn new(inner: Box> + 'a>, store: &'a Store) -> Self { $itername(inner, store) } } diff --git a/lib/core/libimagstore/src/store.rs b/lib/core/libimagstore/src/store.rs index 13fbf245..fc9796f3 100644 --- a/lib/core/libimagstore/src/store.rs +++ b/lib/core/libimagstore/src/store.rs @@ -62,13 +62,13 @@ enum StoreEntryStatus { struct StoreEntry { id: StoreId, store_base: PathBuf, // small sacrefice over lifetimes on the Store type - file: Box, + file: Box, status: StoreEntryStatus, } impl StoreEntry { - fn new(store_base: PathBuf, id: StoreId, backend: &Arc) -> Result { + fn new(store_base: PathBuf, id: StoreId, backend: &Arc) -> Result { let pb = id.clone().with_base(&store_base).into_pathbuf()?; #[cfg(feature = "fs-lock")] @@ -144,7 +144,7 @@ pub struct Store { /// The backend to use /// /// This provides the filesystem-operation functions (or pretends to) - backend: Arc, + backend: Arc, } impl Store { @@ -186,7 +186,7 @@ impl Store { /// Do not use directly, only for testing purposes. pub(crate) fn new_with_backend(location: PathBuf, store_config: &Option, - backend: Arc) -> Result { + backend: Arc) -> Result { use crate::configuration::*; debug!("Building new Store object"); @@ -792,7 +792,7 @@ impl Entry { /// See `Entry::from_str()`, as this function is used internally. This is just a wrapper for /// convenience. - pub fn from_reader(loc: S, file: &mut Read) -> Result { + pub fn from_reader(loc: S, file: &mut dyn Read) -> Result { let text = { let mut s = String::new(); file.read_to_string(&mut s).context(EM::IO)?; diff --git a/lib/core/libimagstore/src/storeid.rs b/lib/core/libimagstore/src/storeid.rs index c1853652..112c619f 100644 --- a/lib/core/libimagstore/src/storeid.rs +++ b/lib/core/libimagstore/src/storeid.rs @@ -248,7 +248,7 @@ macro_rules! module_entry_path_mod { } pub struct StoreIdIterator { - iter: Box>>, + iter: Box>>, } impl Debug for StoreIdIterator { @@ -261,7 +261,7 @@ impl Debug for StoreIdIterator { impl StoreIdIterator { - pub fn new(iter: Box>>) -> StoreIdIterator { + pub fn new(iter: Box>>) -> StoreIdIterator { StoreIdIterator { iter } } @@ -300,7 +300,7 @@ impl<'a> Iterator for StoreIdIteratorWithStore<'a> { impl<'a> StoreIdIteratorWithStore<'a> { - pub fn new(iter: Box>>, store: &'a Store) -> Self { + pub fn new(iter: Box>>, store: &'a Store) -> Self { StoreIdIteratorWithStore(StoreIdIterator::new(iter), store) } diff --git a/lib/domain/libimagtimetrack/src/iter/tag.rs b/lib/domain/libimagtimetrack/src/iter/tag.rs index 696d9824..fcc006d2 100644 --- a/lib/domain/libimagtimetrack/src/iter/tag.rs +++ b/lib/domain/libimagtimetrack/src/iter/tag.rs @@ -27,10 +27,10 @@ use crate::iter::storeid::TagStoreIdIter; use libimagentrytag::tag::is_tag_str; -pub struct TagIter(Box>); +pub struct TagIter(Box>); impl TagIter { - pub fn new(i: Box>) -> TagIter { + pub fn new(i: Box>) -> TagIter { TagIter(i) } diff --git a/lib/entry/libimagentrycategory/src/entry.rs b/lib/entry/libimagentrycategory/src/entry.rs index ea41a10c..9d0e06ba 100644 --- a/lib/entry/libimagentrycategory/src/entry.rs +++ b/lib/entry/libimagentrycategory/src/entry.rs @@ -36,7 +36,7 @@ pub trait EntryCategory { fn set_category(&mut self, s: &str) -> Result<()>; - fn set_category_checked(&mut self, register: &CategoryStore, s: &str) -> Result<()>; + fn set_category_checked(&mut self, register: &dyn CategoryStore, s: &str) -> Result<()>; fn get_category(&self) -> Result; @@ -61,7 +61,7 @@ impl EntryCategory for Entry { /// Check whether a category exists before setting it. /// /// This function should be used by default over EntryCategory::set_category()! - fn set_category_checked(&mut self, register: &CategoryStore, s: &str) -> Result<()> { + fn set_category_checked(&mut self, register: &dyn CategoryStore, s: &str) -> Result<()> { trace!("Setting category '{}' checked", s); let mut category = register .get_category_by_name(s)? diff --git a/lib/etc/libimaginteraction/src/ask.rs b/lib/etc/libimaginteraction/src/ask.rs index f36fa2e0..603374aa 100644 --- a/lib/etc/libimaginteraction/src/ask.rs +++ b/lib/etc/libimaginteraction/src/ask.rs @@ -32,11 +32,11 @@ use failure::Fallible as Result; /// Ask the user for a Yes/No answer. Optionally provide a default value. If none is provided, this /// keeps loop{}ing -pub fn ask_bool(s: &str, default: Option, input: &mut Read, output: &mut Write) -> Result { +pub fn ask_bool(s: &str, default: Option, input: &mut dyn Read, output: &mut dyn Write) -> Result { ask_bool_(s, default, &mut BufReader::new(input), output) } -fn ask_bool_(s: &str, default: Option, input: &mut R, output: &mut Write) -> Result { +fn ask_bool_(s: &str, default: Option, input: &mut R, output: &mut dyn Write) -> Result { lazy_static! { static ref R_YES: Regex = Regex::new(r"^[Yy](\n?)$").unwrap(); static ref R_NO: Regex = Regex::new(r"^[Nn](\n?)$").unwrap(); @@ -68,7 +68,7 @@ fn ask_bool_(s: &str, default: Option, input: &mut R, output: /// trailing questionmark. /// /// The `nl` parameter can be used to configure whether a newline character should be printed -pub fn ask_question(question: &str, nl: bool, output: &mut Write) -> Result<()> { +pub fn ask_question(question: &str, nl: bool, output: &mut dyn Write) -> Result<()> { if nl { writeln!(output, "[imag]: {}?", Yellow.paint(question)) } else { diff --git a/lib/etc/libimaginteraction/src/format.rs b/lib/etc/libimaginteraction/src/format.rs index e34d37ac..4073c61f 100644 --- a/lib/etc/libimaginteraction/src/format.rs +++ b/lib/etc/libimaginteraction/src/format.rs @@ -27,7 +27,7 @@ use ansi_term::Style; pub struct ColorizeBlackHelper; impl HelperDef for ColorizeBlackHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { colorize(Colour::Black, h, out) } } @@ -36,7 +36,7 @@ impl HelperDef for ColorizeBlackHelper { pub struct ColorizeBlueHelper; impl HelperDef for ColorizeBlueHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { colorize(Colour::Blue, h, out) } } @@ -45,7 +45,7 @@ impl HelperDef for ColorizeBlueHelper { pub struct ColorizeCyanHelper; impl HelperDef for ColorizeCyanHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { colorize(Colour::Cyan, h, out) } } @@ -54,7 +54,7 @@ impl HelperDef for ColorizeCyanHelper { pub struct ColorizeGreenHelper; impl HelperDef for ColorizeGreenHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { colorize(Colour::Green, h, out) } } @@ -63,7 +63,7 @@ impl HelperDef for ColorizeGreenHelper { pub struct ColorizePurpleHelper; impl HelperDef for ColorizePurpleHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { colorize(Colour::Purple, h, out) } } @@ -72,7 +72,7 @@ impl HelperDef for ColorizePurpleHelper { pub struct ColorizeRedHelper; impl HelperDef for ColorizeRedHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { colorize(Colour::Red, h, out) } } @@ -81,7 +81,7 @@ impl HelperDef for ColorizeRedHelper { pub struct ColorizeWhiteHelper; impl HelperDef for ColorizeWhiteHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { colorize(Colour::White, h, out) } } @@ -90,13 +90,13 @@ impl HelperDef for ColorizeWhiteHelper { pub struct ColorizeYellowHelper; impl HelperDef for ColorizeYellowHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { colorize(Colour::Yellow, h, out) } } #[inline] -fn colorize(color: Colour, h: &Helper, output: &mut Output) -> Result<(), RenderError> { +fn colorize(color: Colour, h: &Helper, output: &mut dyn Output) -> Result<(), RenderError> { let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; output.write(&format!("{}", color.paint(p.value().render())))?; @@ -107,7 +107,7 @@ fn colorize(color: Colour, h: &Helper, output: &mut Output) -> Result<(), Render pub struct UnderlineHelper; impl HelperDef for UnderlineHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; let s = Style::new().underline(); out.write(&format!("{}", s.paint(p.value().render())))?; @@ -119,7 +119,7 @@ impl HelperDef for UnderlineHelper { pub struct BoldHelper; impl HelperDef for BoldHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; let s = Style::new().bold(); out.write(&format!("{}", s.paint(p.value().render())))?; @@ -131,7 +131,7 @@ impl HelperDef for BoldHelper { pub struct BlinkHelper; impl HelperDef for BlinkHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; let s = Style::new().blink(); out.write(&format!("{}", s.paint(p.value().render())))?; @@ -143,7 +143,7 @@ impl HelperDef for BlinkHelper { pub struct StrikethroughHelper; impl HelperDef for StrikethroughHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { let p = h.param(0).ok_or(RenderError::new("Too few arguments"))?; let s = Style::new().strikethrough(); out.write(&format!("{}", s.paint(p.value().render())))?; @@ -162,7 +162,7 @@ fn param_to_number(idx: usize, h: &Helper) -> Result { pub struct LeftPadHelper; impl HelperDef for LeftPadHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { let count = param_to_number(0, h)? as usize; let text = h.param(1).ok_or(RenderError::new("Too few arguments"))?; let text = format!("{:>width$}", text.value().render(), width = count); @@ -175,7 +175,7 @@ impl HelperDef for LeftPadHelper { pub struct RightPadHelper; impl HelperDef for RightPadHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { let count = param_to_number(0, h)? as usize; let text = h.param(1).ok_or(RenderError::new("Too few arguments"))?; let text = format!("{:width$}", text.value().render(), width = count); @@ -188,7 +188,7 @@ impl HelperDef for RightPadHelper { pub struct AbbrevHelper; impl HelperDef for AbbrevHelper { - fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut Output) -> Result<(), RenderError> { + fn call<'reg: 'rc, 'rc>(&self, h: &Helper<'reg, 'rc>, _r: &'reg Registry, _ctx: &'rc Context, _rc: &mut RenderContext<'reg>, out: &mut dyn Output) -> Result<(), RenderError> { let count = param_to_number(0, h)? as usize; let text = h.param(1).ok_or(RenderError::new("Too few arguments"))?.value().render(); out.write(&text.chars().take(count).collect::())?; -- cgit v1.2.3