conlang: More clippy

This commit is contained in:
John 2025-09-15 00:17:50 -04:00
parent 1fe796dda7
commit 62940b3d24
5 changed files with 8 additions and 8 deletions

View File

@ -3,15 +3,15 @@ use std::fmt::Write;
impl<W: Write + ?Sized> FmtAdapter for W {} impl<W: Write + ?Sized> FmtAdapter for W {}
pub trait FmtAdapter: Write { pub trait FmtAdapter: Write {
fn indent(&mut self) -> Indent<Self> { fn indent(&mut self) -> Indent<'_, Self> {
Indent { f: self } Indent { f: self }
} }
fn delimit(&mut self, delim: Delimiters) -> Delimit<Self> { fn delimit(&mut self, delim: Delimiters) -> Delimit<'_, Self> {
Delimit::new(self, delim) Delimit::new(self, delim)
} }
fn delimit_with(&mut self, open: &'static str, close: &'static str) -> Delimit<Self> { fn delimit_with(&mut self, open: &'static str, close: &'static str) -> Delimit<'_, Self> {
Delimit::new(self, Delimiters { open, close }) Delimit::new(self, Delimiters { open, close })
} }
} }

View File

@ -159,7 +159,7 @@ impl Environment {
/// Enters a nested scope, returning a [`Frame`] stack-guard. /// Enters a nested scope, returning a [`Frame`] stack-guard.
/// ///
/// [`Frame`] implements Deref/DerefMut for [`Environment`]. /// [`Frame`] implements Deref/DerefMut for [`Environment`].
pub fn frame(&mut self, name: &'static str) -> Frame { pub fn frame(&mut self, name: &'static str) -> Frame<'_> {
Frame::new(self, name) Frame::new(self, name)
} }

View File

@ -33,7 +33,7 @@ impl Function {
pub fn decl(&self) -> &FnDecl { pub fn decl(&self) -> &FnDecl {
&self.decl &self.decl
} }
pub fn upvars(&self) -> Ref<Upvars> { pub fn upvars(&self) -> Ref<'_, Upvars> {
self.upvars.borrow() self.upvars.borrow()
} }
pub fn lift_upvars(&self, env: &Environment) { pub fn lift_upvars(&self, env: &Environment) {

View File

@ -328,7 +328,7 @@ pub mod collector {
self.env.modules().get(self.module) self.env.modules().get(self.module)
} }
pub fn as_node_mut(&mut self) -> ModuleNodeMut { pub fn as_node_mut(&mut self) -> ModuleNodeMut<'_> {
self.env.modules_mut().get_mut(self.module) self.env.modules_mut().get_mut(self.module)
} }

View File

@ -54,7 +54,7 @@ pub mod yamler {
Self::default() Self::default()
} }
pub fn indent(&mut self) -> Section { pub fn indent(&mut self) -> Section<'_> {
Section::new(self) Section::new(self)
} }
@ -80,7 +80,7 @@ pub mod yamler {
} }
/// Prints a section header and increases indentation /// Prints a section header and increases indentation
pub fn key(&mut self, name: impl Yamlify) -> Section { pub fn key(&mut self, name: impl Yamlify) -> Section<'_> {
println!(); println!();
self.print_indentation(&mut std::io::stdout().lock()); self.print_indentation(&mut std::io::stdout().lock());
print!(" "); print!(" ");