Skip to content

Commit

Permalink
change log callbacks to FnOnce (#938)
Browse files Browse the repository at this point in the history
  • Loading branch information
suaviloquence authored Sep 19, 2024
1 parent 4d66bed commit 1a56407
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ impl GlobalConfig {

pub fn log_verbose(
&mut self,
callback: impl Fn(&mut Self) -> anyhow::Result<()>,
callback: impl FnOnce(&mut Self) -> anyhow::Result<()>,
) -> anyhow::Result<()> {
if self.is_verbose() {
callback(self)?;
Expand All @@ -85,7 +85,7 @@ impl GlobalConfig {

pub fn log_extra_verbose(
&mut self,
callback: impl Fn(&mut Self) -> anyhow::Result<()>,
callback: impl FnOnce(&mut Self) -> anyhow::Result<()>,
) -> anyhow::Result<()> {
if self.is_extra_verbose() {
callback(self)?;
Expand All @@ -95,7 +95,7 @@ impl GlobalConfig {

pub fn log_info(
&mut self,
callback: impl Fn(&mut Self) -> anyhow::Result<()>,
callback: impl FnOnce(&mut Self) -> anyhow::Result<()>,
) -> anyhow::Result<()> {
if self.is_info() {
callback(self)?;
Expand All @@ -105,7 +105,7 @@ impl GlobalConfig {

pub fn log_error(
&mut self,
callback: impl Fn(&mut Self) -> anyhow::Result<()>,
callback: impl FnOnce(&mut Self) -> anyhow::Result<()>,
) -> anyhow::Result<()> {
if self.is_error() {
callback(self)?;
Expand Down

0 comments on commit 1a56407

Please sign in to comment.