Mercurial > crates > nonstick
comparison src/logging.rs @ 123:98a624cacd82
Get rid of all the warnings, and arrange attributes.
author | Paul Fisher <paul@pfish.zone> |
---|---|
date | Mon, 30 Jun 2025 04:26:44 -0400 |
parents | 39760dfc9b3b |
children |
comparison
equal
deleted
inserted
replaced
122:9e05e44050d0 | 123:98a624cacd82 |
---|---|
177 macro_rules! debug { ($handle:expr, $($arg:tt)+) => { $crate::__log_internal!($handle, Debug, $($arg)+);}} | 177 macro_rules! debug { ($handle:expr, $($arg:tt)+) => { $crate::__log_internal!($handle, Debug, $($arg)+);}} |
178 | 178 |
179 #[cfg(test)] | 179 #[cfg(test)] |
180 mod tests { | 180 mod tests { |
181 use super::*; | 181 use super::*; |
182 use regex::Regex; | |
183 use std::cell::RefCell; | 182 use std::cell::RefCell; |
184 | 183 |
185 #[test] | 184 #[test] |
186 fn test_logging() { | 185 fn test_logging() { |
187 struct Logger(RefCell<Vec<(Level, String)>>); | 186 struct Logger(RefCell<Vec<(Level, String)>>); |
188 | 187 |
189 impl Logger { | 188 impl Logger { |
190 fn log(&self, level: Level, loc: Location<'_>, text: &str) { | 189 fn log(&self, level: Level, _: Location<'_>, text: &str) { |
191 self.0.borrow_mut().push((level, text.to_owned())) | 190 self.0.borrow_mut().push((level, text.to_owned())) |
192 } | 191 } |
193 } | 192 } |
194 | 193 |
195 let logger = Logger(Default::default()); | 194 let logger = Logger(Default::default()); |