Word save feature.

This commit is contained in:
AB
2020-12-06 23:55:09 +03:00
parent b6f5228ce8
commit 7e57e8f706
11 changed files with 2252 additions and 116 deletions

View File

@ -3,6 +3,7 @@ use rusqlite::Error as sqlite_error;
use rusqlite::{named_params, params, Connection, Result};
use std::{fmt, io, io::Error as io_error};
use telegram_bot::Error as tg_error;
use serde_json::Error as serde_error;
#[derive(Debug)]
pub(crate) enum Error {
@ -13,6 +14,7 @@ pub(crate) enum Error {
ConfNotFound,
IOError(io_error),
FileNotFound,
JsonParseError(serde_error),
}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
@ -42,4 +44,10 @@ impl From<io_error> for Error {
fn from(e: io_error) -> Error {
return Error::IOError(e);
}
}
}
impl From<serde_error> for Error {
fn from(e: serde_error) -> Error {
return Error::JsonParseError(e);
}
}