Skip to content

Commit 2b305e8

Browse files
committed
Apply clippy's suggestion
- Replace `Box::new(T::default())` with `Box::default()`. - Allow `needless_borrow` in intentional test cases.
1 parent 82c2ad5 commit 2b305e8

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

spdlog/examples/05_custom_formatter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fn impl_manually() {
6666
}
6767

6868
// Building a custom formatter.
69-
let new_formatter: Box<MyFormatter> = Box::new(MyFormatter::default());
69+
let new_formatter: Box<MyFormatter> = Box::default();
7070

7171
// Setting the new formatter for each sink of the default logger.
7272
for sink in spdlog::default_logger().sinks() {

spdlog/src/formatter/pattern_formatter/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,11 +1249,13 @@ pub mod tests {
12491249

12501250
#[test]
12511251
fn test_pattern_ref_as_pattern() {
1252+
#[allow(clippy::needless_borrow)]
12521253
test_pattern(&String::from("literal"), "literal", None);
12531254
}
12541255

12551256
#[test]
12561257
fn test_pattern_mut_as_pattern() {
1258+
#[allow(clippy::needless_borrow)]
12571259
test_pattern(&mut String::from("literal"), "literal", None);
12581260
}
12591261

0 commit comments

Comments
 (0)