Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Pietrek <[email protected]>
  • Loading branch information
Jarema committed Oct 7, 2023
1 parent cee81b6 commit 0667d72
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions async-nats/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ impl Client {
if let Some(inbox) = request.inbox {
let timeout = request.timeout.unwrap_or(self.request_timeout);
let mut subscriber = self.subscribe(inbox.clone().into()).await?;
let payload: Bytes = request.payload.unwrap_or_else(Bytes::new);
let payload: Bytes = request.payload.unwrap_or_default();
match request.headers {
Some(headers) => {
self.publish_with_reply_and_headers(subject, inbox.into(), headers, payload)
Expand Down Expand Up @@ -381,7 +381,7 @@ impl Client {
} else {
let (sender, receiver) = oneshot::channel();

let payload = request.payload.unwrap_or_else(Bytes::new);
let payload = request.payload.unwrap_or_default();
let respond = self.new_inbox().into();
let headers = request.headers;

Expand Down
1 change: 0 additions & 1 deletion async-nats/src/jetstream/consumer/pull.rs
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,6 @@ impl Stream {
let batch = batch_config;
let consumer = consumer.clone();
let mut context = consumer.context.clone();
let subject = subject;
let inbox = inbox.clone();
async move {
loop {
Expand Down
5 changes: 1 addition & 4 deletions nats/nats_test_server/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,10 +436,7 @@ impl Client {
let subject = parts.next().unwrap();
let sid = parts.next().unwrap();
assert_eq!(parts.next(), None);
let entry = self
.subs
.entry(subject.to_string())
.or_insert_with(HashSet::new);
let entry = self.subs.entry(subject.to_string()).or_default();
entry.insert(sid.to_string());
ClientAction::None
}
Expand Down

0 comments on commit 0667d72

Please sign in to comment.