···6969 Ok(state.into_iter())
7070}
71717272-impl<'e, 's> State<'e, 's> {
7272+impl<'e> State<'e, '_> {
7373 /// Returns `Some(String)` when it could successfully emit an event but there was
7474 /// something unexpected about it, e.g. a footnote with a missing definition.
7575 fn handle(
···371371 KnownSyntax(ClassedHTMLGenerator<'s>),
372372}
373373374374-impl<'a> std::fmt::Debug for Highlighting<'a> {
374374+impl std::fmt::Debug for Highlighting<'_> {
375375 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
376376 match self {
377377 Self::RequiresFirstLineParse => write!(f, "RequiresFirstLineParse"),
···11use std::{
22 collections::HashMap,
33+ fmt,
34 hash::Hash,
45 os::unix::prelude::OsStrExt,
56 path::{Path, PathBuf},
···3536 source,
3637 cascade,
3738 String::from("base.jinja"), // TODO: not this
3838- &md,
3939+ md,
3940 )
4041 .map_err(Error::from)
4142 })?;
···5051 to_render: ToRender<'e>,
5152}
52535353-impl<'e> Prepared<'e> {
5454+impl Prepared<'_> {
5455 pub fn render(
5556 self,
5657 md: &Markdown,
···8485#[derive(Debug, Hash, PartialEq, Eq, PartialOrd, Deserialize, Serialize)]
8586pub struct Id(Uuid);
86878787-impl Id {
8888- fn to_string(&self) -> String {
8989- self.0.to_string()
8888+impl fmt::Display for Id {
8989+ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
9090+ write!(f, "{}", self.0)
9091 }
9192}
9293···211212212213// TODO: This will need to take `From` a different type, one that wraps `Page`
213214// and probably also `Config` (e.g. to build the full URL).
214214-impl<'p, 'c, 'e> From<PageAndConfig<'p, 'c, 'e>> for json_feed::FeedItem {
215215+impl From<PageAndConfig<'_, '_, '_>> for json_feed::FeedItem {
215216 fn from(PageAndConfig(page, config): PageAndConfig) -> Self {
216217 json_feed::FeedItem {
217218 id: page.id.to_string(),
···239240 fn updated(&self) -> DateTime<FixedOffset>;
240241}
241242242242-impl<'e> Updated for [Page<'e>] {
243243+impl Updated for [Page<'_>] {
243244 fn updated(&self) -> chrono::DateTime<chrono::FixedOffset> {
244245 self
245246 .iter()
+1-1
lx/src/server.rs
···5151 // This does not presently change for any reason. In principle it *could*, e.g. if I
5252 // wanted to reload it when config changed to support reloading syntaxes. For now,
5353 // though, this is sufficient.
5454- let md = Markdown::new();
5454+ let md = Markdown::new(None);
55555656 // 1. Run an initial build.
5757 // 2. Create a watcher on the *input* directory, *not* the output directory.
+1-1
lx/src/templates/functions.rs
···8080fn fancy_debug(name: Option<&str>, args: Rest<Value>) -> String {
8181 let title = name.map(|n| format!("<p>{n}:</p>")).unwrap_or_default();
8282 let args = if args.is_empty() {
8383- format!("{{no args!}}")
8383+ "{no args!}".to_string()
8484 } else if args.len() == 1 {
8585 format!("{:#?}", args.0[0])
8686 } else {
+2-2
lx/src/templates/mod.rs
···5757 for path in templates {
5858 let path = path.as_ref();
5959 let name = trim_root(path)?.to_string_lossy().to_string();
6060- let content = std::fs::read_to_string(&path)?;
6060+ let content = std::fs::read_to_string(path)?;
6161 trace!("Adding template at {name}");
6262 env.add_template_owned(name, content).map_err(|source| {
6363 Error::CouldNotAddTemplate {
···109109 data: &page.data,
110110 config: site,
111111 path: &page.path,
112112- source: &page.source,
112112+ source: page.source,
113113 },
114114 into,
115115 )