From a2e8dab9b04cba60e80c31b3ee13826aee1d25cb Mon Sep 17 00:00:00 2001 From: Tilo K Date: Thu, 26 Oct 2023 21:55:41 +0200 Subject: [PATCH] Setting paste name to filename --- src/pastebin.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pastebin.rs b/src/pastebin.rs index c03af55..e0d3bd4 100644 --- a/src/pastebin.rs +++ b/src/pastebin.rs @@ -32,13 +32,14 @@ pub async fn create_paste( map.insert("api_paste_code", content); map.insert("api_paste_private", "0".to_owned()); map.insert("api_paste_expire_date", "1W".to_owned()); + map.insert("api_paste_name", name); if paste_id.is_some() { let id = paste_id.unwrap(); map.insert("api_paste_key", id); } - let mut req = client + let req = client .post("https://pastebin.com/api/api_post.php") .form(&map);