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:
parent
9efbaefd92
commit
4b445a6a96
5 changed files with 18 additions and 4 deletions
|
@ -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),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue