diff --git a/src/app.rs b/src/app.rs index d51443b..e61d5cd 100644 --- a/src/app.rs +++ b/src/app.rs @@ -73,6 +73,7 @@ impl<'a> Default for App<'a> { } impl<'a> App<'a> { + #[allow(dead_code)] fn new_test_db() -> Self { Self { db: Box::new(DB::new_test().expect("Failed to create database")), diff --git a/src/request/curl.rs b/src/request/curl.rs index 67d89d1..99f15f6 100644 --- a/src/request/curl.rs +++ b/src/request/curl.rs @@ -568,6 +568,9 @@ impl Curl { if self.ser { self.opts.push(AppOptions::RequestBody(body.to_string())); } + if self.opts.iter().any(|x| std::mem::discriminant(x) == std::mem::discriminant(&AppOptions::RequestBody(body.to_string()))) { + self.opts.retain(|x| std::mem::discriminant(x) != std::mem::discriminant(&AppOptions::RequestBody(body.to_string()))); + } self.opts.push(AppOptions::RequestBody(body.to_string())); self.curl .post_fields_copy(body.as_bytes())