mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-04 19:41:27 +03:00
move confy here
This commit is contained in:
16
libs/confy/src/utils.rs
Normal file
16
libs/confy/src/utils.rs
Normal file
@@ -0,0 +1,16 @@
|
||||
//! Some storage utilities
|
||||
|
||||
use std::fs::File;
|
||||
use std::io::{Error as IoError, Read};
|
||||
|
||||
pub trait CheckedStringRead {
|
||||
fn get_string(&mut self) -> Result<String, IoError>;
|
||||
}
|
||||
|
||||
impl CheckedStringRead for File {
|
||||
fn get_string(&mut self) -> Result<String, IoError> {
|
||||
let mut s = String::new();
|
||||
self.read_to_string(&mut s)?;
|
||||
Ok(s)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user