Skip to content

Commit e7615fd

Browse files
committed
use FormatAdvice::default() where possible
1 parent 4f5f9e6 commit e7615fd

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

cpp-linter/src/clang_tools/clang_format.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,7 @@ pub fn run_clang_format(
151151
format!("Failed to parse XML output from clang-format for {file_name}")
152152
})?
153153
} else {
154-
FormatAdvice {
155-
replacements: vec![],
156-
patched: None,
157-
}
154+
FormatAdvice::default()
158155
};
159156
format_advice.patched = patched;
160157
if !format_advice.replacements.is_empty() {
@@ -203,10 +200,7 @@ mod tests {
203200
</replacements>"#
204201
.as_bytes()
205202
.to_vec();
206-
let expected = FormatAdvice {
207-
replacements: vec![],
208-
patched: None,
209-
};
203+
let expected = FormatAdvice::default();
210204
let xml = String::from_utf8(xml_raw).unwrap();
211205
let document = quick_xml::de::from_str::<FormatAdvice>(&xml).unwrap();
212206
assert_eq!(expected, document);

0 commit comments

Comments
 (0)