about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohann Hemmann <johann.hemmann@code.berlin>2024-01-30 12:03:33 +0100
committerJohann Hemmann <johann.hemmann@code.berlin>2024-01-31 19:06:36 +0100
commitd37f4e0d21577753f3be96549e0d4e99ac5ae2e2 (patch)
treedc6912f22820a2e686ff9051f0316fa2446fcdfb
parente7e09e775019171a31649ef3256507981e6c085c (diff)
downloadrust-d37f4e0d21577753f3be96549e0d4e99ac5ae2e2.tar.gz
rust-d37f4e0d21577753f3be96549e0d4e99ac5ae2e2.zip
new_without_default
-rw-r--r--Cargo.toml1
-rw-r--r--crates/hir-def/src/hir/format_args.rs4
2 files changed, 2 insertions, 3 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 365f7db3749..53581c4460d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -171,7 +171,6 @@ derived_hash_with_manual_eq = "allow"
 forget_non_drop = "allow"
 format_collect = "allow"
 needless_doctest_main = "allow"
-new_without_default = "allow"
 non_canonical_clone_impl = "allow"
 non_canonical_partial_ord_impl = "allow"
 self_named_constructors = "allow"
diff --git a/crates/hir-def/src/hir/format_args.rs b/crates/hir-def/src/hir/format_args.rs
index 22864b32894..b097a721c75 100644
--- a/crates/hir-def/src/hir/format_args.rs
+++ b/crates/hir-def/src/hir/format_args.rs
@@ -433,7 +433,7 @@ pub(crate) fn parse(
     }
 }
 
-#[derive(Debug, Clone, PartialEq, Eq)]
+#[derive(Clone, Debug, Default, Eq, PartialEq)]
 pub struct FormatArgumentsCollector {
     arguments: Vec<FormatArgument>,
     num_unnamed_args: usize,
@@ -452,7 +452,7 @@ impl FormatArgumentsCollector {
     }
 
     pub fn new() -> Self {
-        Self { arguments: vec![], names: vec![], num_unnamed_args: 0, num_explicit_args: 0 }
+        Default::default()
     }
 
     pub fn add(&mut self, arg: FormatArgument) -> usize {