From dc5d3a18df3767f4485b5cfb1a29c45ae04781e0 Mon Sep 17 00:00:00 2001 From: benluiwj Date: Sat, 9 Nov 2024 11:23:51 +0800 Subject: [PATCH] add checkdiff fn configs --- check_diff/src/lib.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/check_diff/src/lib.rs b/check_diff/src/lib.rs index 072b2f5d5c1..d05ff874205 100644 --- a/check_diff/src/lib.rs +++ b/check_diff/src/lib.rs @@ -227,6 +227,35 @@ pub fn build_rustfmt_from_src(binary_path: PathBuf) -> Result>) { + let config_arg: String = match config { + Some(configs) => { + let mut result = String::new(); + result.push(','); + for arg in configs.iter() { + result.push_str(arg.as_str()); + result.push(','); + } + result.pop(); + result + } + None => String::new(), + }; + let config = format!( + "error_on_line_overflow=false,error_on_unformatted=false{}", + config_arg.as_str() + ); +} + // Compiles and produces two rustfmt binaries. // One for the current master, and another for the feature branch // Parameters: