Skip to content

Commit

Permalink
f read_to_string
Browse files Browse the repository at this point in the history
  • Loading branch information
jrconlin committed May 4, 2022
1 parent 3036809 commit 7f1a856
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions autoendpoint/src/routers/fcm/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ use crate::routers::RouterError;
use reqwest::StatusCode;
use serde::Deserialize;
use std::collections::HashMap;
use std::fs::File;
use std::io::Read;
use std::path::Path;
use std::time::Duration;
use url::Url;
Expand Down Expand Up @@ -57,9 +55,7 @@ impl FcmClient {
"Reading credential for {} from file...",
&server_credential.project_id
);
let mut file = File::open(&server_credential.server_access_token)?;
let mut content = String::new();
file.read_to_string(&mut content)?;
let content = std::fs::read_to_string(&server_credential.server_access_token)?;
let key_data = serde_json::from_str::<ServiceAccountKey>(&content)?;
Some(
ServiceAccountAuthenticator::builder(key_data)
Expand Down

0 comments on commit 7f1a856

Please sign in to comment.