We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8e47fbf commit b37b4c6Copy full SHA for b37b4c6
src/main.rs
@@ -52,7 +52,7 @@ fn get_request_method(args: & Args) -> Method {
52
}
53
54
55
-fn get_protocols(protocols: &String) -> Protocols
+fn get_protocols(protocols: &str) -> Protocols
56
{
57
let mut result = Protocols {http: true, https: true };
58
for part in protocols.split(',') {
@@ -334,8 +334,7 @@ async fn main() -> ExitCode {
334
335
// data
336
if let Some(ref data) = args.data {
337
- if Some('@') == data.chars().next() {
338
- let filename = &data[1..];
+ if let Some(filename) = data.strip_prefix('@') {
339
let file = TokioFile::open(filename).await;
340
if let Ok(file) = file {
341
request_builder = request_builder.body(file);
0 commit comments