toasty 0.2.0

An async ORM for Rust supporting SQL and NoSQL databases
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use super::Simplify;
use toasty_core::stmt;

impl Simplify<'_> {
    pub(super) fn simplify_expr_cast(&self, expr: &mut stmt::ExprCast) -> Option<stmt::Expr> {
        if let stmt::Expr::Value(value) = &mut *expr.expr {
            let cast = expr.ty.cast(value.take()).unwrap();
            Some(cast.into())
        } else {
            None
        }
    }
}