Skip to content

Commit

Permalink
remove unused file_name_header field from Body::File
Browse files Browse the repository at this point in the history
  • Loading branch information
ducaale committed Jun 17, 2024
1 parent 7841303 commit ca629c8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
4 changes: 0 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,10 +418,6 @@ fn run(args: Cli) -> Result<i32> {
Body::File {
file_name,
file_type,
// We could turn this into a Content-Disposition header, but
// that has no effect, so just ignore it
// (Additional precedent: HTTPie ignores file_type here)
file_name_header: _,
} => request_builder.body(File::open(file_name)?).header(
CONTENT_TYPE,
file_type.unwrap_or_else(|| HeaderValue::from_static(JSON_CONTENT_TYPE)),
Expand Down
4 changes: 1 addition & 3 deletions src/request_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,6 @@ pub enum Body {
File {
file_name: PathBuf,
file_type: Option<HeaderValue>,
file_name_header: Option<String>,
},
}

Expand Down Expand Up @@ -423,7 +422,7 @@ impl RequestItems {
key,
file_name,
file_type,
file_name_header,
file_name_header: _,
} => {
assert!(key.is_empty());
if body.is_some() {
Expand All @@ -436,7 +435,6 @@ impl RequestItems {
.map(HeaderValue::from_str)
.transpose()?,
file_name: expand_tilde(file_name),
file_name_header,
});
}
RequestItem::HttpHeader(..)
Expand Down
1 change: 0 additions & 1 deletion src/to_curl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,6 @@ pub fn translate(args: Cli) -> Result<Command> {
Body::File {
file_name,
file_type,
file_name_header: _,
} => {
if let Some(file_type) = file_type {
cmd.header("content-type", file_type.to_str()?);
Expand Down

0 comments on commit ca629c8

Please sign in to comment.