Skip to content

Commit

Permalink
refactor: #4 pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
adnanjpg committed Mar 3, 2024
1 parent e9d5d9d commit 2128a95
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 18 deletions.
1 change: 0 additions & 1 deletion a.sh

This file was deleted.

7 changes: 1 addition & 6 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl Client {
Err(err) => return Err(err.to_string()),
};

let token_no_bearer = access_token.split(" ").collect::<Vec<&str>>()[1];
let token_no_bearer = access_token.split(char::is_whitespace).collect::<Vec<&str>>()[1];

Ok(token_no_bearer.to_string())
}
Expand Down Expand Up @@ -140,11 +140,6 @@ impl Client {
.body(Body::from(payload))
.build()?;

// print the body
let body = request.body().unwrap();
let body = std::str::from_utf8(body.as_bytes().unwrap()).unwrap();
println!("body: {}", body);

let response = self.http_client.execute(request).await?;

let response_status = response.status();
Expand Down
11 changes: 0 additions & 11 deletions src/message/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,6 @@ fn should_be_able_to_render_a_full_condition_message_to_json() {
#[test]
fn should_set_notifications() {
let target = Target::Token("token".to_string());
let msg = Message {
target: target.clone(),
data: None,
notification: None,
android: None,
webpush: None,
apns: None,
fcm_options: None,
};

assert_eq!(msg.notification.is_none(), true);

let nm = Notification {
title: None,
Expand Down

0 comments on commit 2128a95

Please sign in to comment.