0
0
Fork 0
mirror of https://git.verdigado.com/NB-Public/simple-wkd.git synced 2024-12-06 14:52:41 +01:00

Improve file checking

This commit is contained in:
Delta1925 2023-04-13 22:55:05 +02:00
parent 9efbaefd92
commit 4b445a6a96
No known key found for this signature in database
GPG key ID: 1C21ACE44193CB25
5 changed files with 18 additions and 4 deletions

View file

@ -9,7 +9,7 @@ use std::path::Path;
pub fn confirm_action(token: &str) -> Result<(), Error> {
let pending_path = pending_path!().join(token);
let content = if pending_path.exists() {
let content = if pending_path.is_file() {
match fs::read_to_string(&pending_path) {
Ok(content) => content,
Err(_) => return Err(Error::Inaccessible),