Update utils.rs

This commit is contained in:
dullbananas 2023-12-20 16:15:04 -07:00 committed by GitHub
parent 49ca4da763
commit fc300083a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -416,10 +416,7 @@ static EMAIL_REGEX: Lazy<Regex> = Lazy::new(|| {
}); });
pub mod functions { pub mod functions {
use diesel::{ use diesel::sql_types::{BigInt, Text, Timestamptz};
pg::Pg,
sql_types::{BigInt, Text, Timestamptz},
};
sql_function! { sql_function! {
fn hot_rank(score: BigInt, time: Timestamptz) -> Double; fn hot_rank(score: BigInt, time: Timestamptz) -> Double;
@ -437,9 +434,6 @@ pub mod functions {
// really this function is variadic, this just adds the two-argument version // really this function is variadic, this just adds the two-argument version
sql_function!(fn coalesce<T: diesel::sql_types::SqlType + diesel::sql_types::SingleValue>(x: diesel::sql_types::Nullable<T>, y: T) -> T); sql_function!(fn coalesce<T: diesel::sql_types::SqlType + diesel::sql_types::SingleValue>(x: diesel::sql_types::Nullable<T>, y: T) -> T);
// Use `AsText::new`
postfix_operator!(AsText, "::text", Text, backend: Pg);
} }
pub const DELETED_REPLACEMENT_TEXT: &str = "*Permanently Deleted*"; pub const DELETED_REPLACEMENT_TEXT: &str = "*Permanently Deleted*";