Skip to content

Commit

Permalink
Fix clippy linting issues (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
buinauskas authored Feb 19, 2024
1 parent 1ab31a9 commit 1285811
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 4 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,25 @@ fn track_search_event() {
track(event, portal, debug_pin, search_event);
}
```

## Try locally

To run UDP example:

1. Listen for events:

```shell
nc -kul 5005
```

2. In separate session, run example:

```shell
cargo run --package vinted_event_tracker --example udp
```

3. See captured events, like:

```json
{"event":"event","portal":"portal","time":1708000488315,"debug_pin":1234,"iteration":945}
```
4 changes: 3 additions & 1 deletion src/http_relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Relay for HttpRelay {
request = request.header("X-Debug-Pin", debug_pin);
}

let _ = tokio::spawn(async move {
let result = tokio::spawn(async move {
let response = match request.send().await {
Ok(response) => response,
Err(error) => {
Expand All @@ -58,5 +58,7 @@ impl Relay for HttpRelay {
}
}
});

drop(result);
}
}
2 changes: 0 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,13 @@
#![deny(
warnings,
bad_style,
const_err,
dead_code,
improper_ctypes,
non_shorthand_field_patterns,
no_mangle_generic_items,
overflowing_literals,
path_statements,
patterns_in_fns_without_body,
private_in_public,
unconditional_recursion,
unused,
unused_allocation,
Expand Down
4 changes: 3 additions & 1 deletion src/udp_relay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ impl Relay for UdpRelay {
fn transport(&self, _: Metadata, serialized_event: Vec<u8>) {
let udp_socket = self.udp_socket.clone();

let _ = tokio::spawn(async move { udp_socket.send(&serialized_event).await });
let result = tokio::spawn(async move { udp_socket.send(&serialized_event).await });

drop(result);
}
}

Expand Down

0 comments on commit 1285811

Please sign in to comment.