.try_into()?
}
+#[derive(Debug)]
+enum PerhapsSubst<'i> {
+ Y(String),
+ N(&'i str),
+}
+
+impl<'i> PerhapsSubst<'i> {
+ #[throws(SubstError)]
+ pub fn finish(self) -> String { match self {
+ PerhapsSubst::N(s) => s.to_owned(),
+ PerhapsSubst::Y(s) => s,
+ } }
+ pub fn chain(&'i self) -> &'i str { match self {
+ PerhapsSubst::N(s) => s,
+ PerhapsSubst::Y(s) => s,
+ } }
+}
+
#[throws(LibraryLoadError)]
fn process_files_entry(
src: &mut dyn LibrarySvgNoter, l: &mut Catalogue,
},
};
- #[derive(Debug)]
- enum PerhapsSubst<'i> {
- Y(String),
- N(&'i str),
- }
-
- impl<'i> PerhapsSubst<'i> {
- #[throws(SubstError)]
- pub fn finish(self) -> String { match self {
- PerhapsSubst::N(s) => s.to_owned(),
- PerhapsSubst::Y(s) => s,
- } }
- pub fn chain(&'i self) -> &'i str { match self {
- PerhapsSubst::N(s) => s,
- PerhapsSubst::Y(s) => s,
- } }
- }
-
fn colour_subst_1<'s, S>(subst: S, kv: Option<(&'static str, &'s str)>)
-> impl for <'i> Fn(&'i str) -> Result<PerhapsSubst<'i>, SubstError> + 's
where S: Fn(&str, &'static str, &str) -> Result<String, SubstError> + 's