mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 21:47:02 +00:00
Start work on notifications from client, cargo fmt
This commit is contained in:
@@ -2,9 +2,9 @@ use rand::{distributions::Alphanumeric, Rng};
|
||||
use std::collections::HashSet;
|
||||
use std::iter::FromIterator;
|
||||
|
||||
pub mod captcha;
|
||||
pub mod email;
|
||||
pub mod result;
|
||||
pub mod captcha;
|
||||
pub mod variables;
|
||||
|
||||
pub fn vec_to_set<T: Clone + Eq + std::hash::Hash>(data: &[T]) -> HashSet<T> {
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
use rocket::response::{self, Responder, Response};
|
||||
use rocket::http::{ContentType, Status};
|
||||
use validator::ValidationErrors;
|
||||
use rocket::request::Request;
|
||||
use serde::Serialize;
|
||||
use std::io::Cursor;
|
||||
use snafu::Snafu;
|
||||
use json;
|
||||
use rocket::http::{ContentType, Status};
|
||||
use rocket::request::Request;
|
||||
use rocket::response::{self, Responder, Response};
|
||||
use serde::Serialize;
|
||||
use snafu::Snafu;
|
||||
use std::io::Cursor;
|
||||
use validator::ValidationErrors;
|
||||
|
||||
#[derive(Serialize, Debug, Snafu)]
|
||||
#[serde(tag = "type")]
|
||||
@@ -16,7 +16,7 @@ pub enum Error {
|
||||
// ? Onboarding related errors.
|
||||
#[snafu(display("Already finished onboarding."))]
|
||||
AlreadyOnboarded,
|
||||
|
||||
|
||||
// ? User related errors.
|
||||
#[snafu(display("Username has already been taken."))]
|
||||
UsernameTaken,
|
||||
@@ -35,7 +35,10 @@ pub enum Error {
|
||||
#[snafu(display("Failed to validate fields."))]
|
||||
FailedValidation { error: ValidationErrors },
|
||||
#[snafu(display("Encountered a database error."))]
|
||||
DatabaseError { operation: &'static str, with: &'static str },
|
||||
DatabaseError {
|
||||
operation: &'static str,
|
||||
with: &'static str,
|
||||
},
|
||||
#[snafu(display("Internal server error."))]
|
||||
InternalError,
|
||||
#[snafu(display("This request had no effect."))]
|
||||
|
||||
Reference in New Issue
Block a user