Skip to content

Commit b37b4c6

Browse files
committed
apply clippy recommends
Signed-off-by: Falk Werner <falk.werner@gmx.net>
1 parent 8e47fbf commit b37b4c6

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/main.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ fn get_request_method(args: & Args) -> Method {
5252
}
5353
}
5454

55-
fn get_protocols(protocols: &String) -> Protocols
55+
fn get_protocols(protocols: &str) -> Protocols
5656
{
5757
let mut result = Protocols {http: true, https: true };
5858
for part in protocols.split(',') {
@@ -334,8 +334,7 @@ async fn main() -> ExitCode {
334334

335335
// data
336336
if let Some(ref data) = args.data {
337-
if Some('@') == data.chars().next() {
338-
let filename = &data[1..];
337+
if let Some(filename) = data.strip_prefix('@') {
339338
let file = TokioFile::open(filename).await;
340339
if let Ok(file) = file {
341340
request_builder = request_builder.body(file);

0 commit comments

Comments
 (0)