From e93f76b9168c4826414aea0690fcf0adc147f589 Mon Sep 17 00:00:00 2001 From: Pa1NarK <69745008+pixincreate@users.noreply.github.com> Date: Thu, 9 Nov 2023 01:14:42 +0530 Subject: [PATCH] ci(rustman): Fix Rustman custom headers (#2813) --- crates/test_utils/src/newman_runner.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/crates/test_utils/src/newman_runner.rs b/crates/test_utils/src/newman_runner.rs index af7fb5592813..a6e0268e2c29 100644 --- a/crates/test_utils/src/newman_runner.rs +++ b/crates/test_utils/src/newman_runner.rs @@ -1,10 +1,4 @@ -use std::{ - env, - fs::OpenOptions, - io::{self, Write}, - path::Path, - process::Command, -}; +use std::{env, io::Write, path::Path, process::Command}; use clap::{arg, command, Parser}; use masking::PeekInterface; @@ -52,22 +46,22 @@ fn get_path(name: impl AsRef) -> String { // This function currently allows you to add only custom headers. // In future, as we scale, this can be modified based on the need -fn insert_content(dir: T, content_to_insert: U) -> io::Result<()> +fn insert_content(dir: T, content_to_insert: U) -> std::io::Result<()> where - T: AsRef + std::fmt::Debug, - U: AsRef + std::fmt::Debug, + T: AsRef, + U: AsRef, { let file_name = "event.prerequest.js"; let file_path = dir.as_ref().join(file_name); // Open the file in write mode or create it if it doesn't exist - let mut file = OpenOptions::new() + let mut file = std::fs::OpenOptions::new() .write(true) .append(true) .create(true) .open(file_path)?; - write!(file, "\n{:#?}", content_to_insert)?; + write!(file, "{}", content_to_insert.as_ref())?; Ok(()) }