aboutsummaryrefslogtreecommitdiff
path: root/src/api/admin.rs
diff options
context:
space:
mode:
authorDaniel García <[email protected]>2022-07-15 19:13:26 +0200
committerDaniel García <[email protected]>2022-07-15 19:13:26 +0200
commitc9376e312688b7cb711792e6be3da195c4a8070c (patch)
treef34e8ce3d0561d77731e8ff36268a635f926e97b /src/api/admin.rs
parent7cbcad0e389d6017b941e00051621010066bf796 (diff)
downloadvaultwarden-c9376e312688b7cb711792e6be3da195c4a8070c.tar.gz
vaultwarden-c9376e312688b7cb711792e6be3da195c4a8070c.zip
Remove read_file and read_file_string and replace them with the std alternatives
Diffstat (limited to 'src/api/admin.rs')
-rw-r--r--src/api/admin.rs5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/api/admin.rs b/src/api/admin.rs
index 19638ef3..2f946fc5 100644
--- a/src/api/admin.rs
+++ b/src/api/admin.rs
@@ -536,15 +536,14 @@ async fn get_release_info(has_http_access: bool, running_within_docker: bool) ->
#[get("/diagnostics")]
async fn diagnostics(_token: AdminToken, ip_header: IpHeader, conn: DbConn) -> ApiResult<Html<String>> {
- use crate::util::read_file_string;
use chrono::prelude::*;
use std::net::ToSocketAddrs;
// Get current running versions
let web_vault_version: WebVaultVersion =
- match read_file_string(&format!("{}/{}", CONFIG.web_vault_folder(), "vw-version.json")) {
+ match std::fs::read_to_string(&format!("{}/{}", CONFIG.web_vault_folder(), "vw-version.json")) {
Ok(s) => serde_json::from_str(&s)?,
- _ => match read_file_string(&format!("{}/{}", CONFIG.web_vault_folder(), "version.json")) {
+ _ => match std::fs::read_to_string(&format!("{}/{}", CONFIG.web_vault_folder(), "version.json")) {
Ok(s) => serde_json::from_str(&s)?,
_ => WebVaultVersion {
version: String::from("Version file missing"),