* `FromQueryResult` proc_macro no longer add `TryGetable` trait bound to generic types * clippy
59 lines
977 B
Rust
59 lines
977 B
Rust
use sea_orm::{FromQueryResult, TryGetable};
|
|
|
|
#[derive(FromQueryResult)]
|
|
struct SimpleTest {
|
|
_foo: i32,
|
|
_bar: String,
|
|
}
|
|
|
|
#[derive(FromQueryResult)]
|
|
struct GenericTest<T: TryGetable> {
|
|
_foo: i32,
|
|
_bar: T,
|
|
}
|
|
|
|
#[derive(FromQueryResult)]
|
|
struct DoubleGenericTest<T: TryGetable, F: TryGetable> {
|
|
_foo: T,
|
|
_bar: F,
|
|
}
|
|
|
|
#[derive(FromQueryResult)]
|
|
struct BoundsGenericTest<T: TryGetable + Copy + Clone + 'static> {
|
|
_foo: T,
|
|
}
|
|
|
|
#[derive(FromQueryResult)]
|
|
struct WhereGenericTest<T>
|
|
where
|
|
T: TryGetable + Copy + Clone + 'static,
|
|
{
|
|
_foo: T,
|
|
}
|
|
|
|
#[derive(FromQueryResult)]
|
|
struct AlreadySpecifiedBoundsGenericTest<T: TryGetable> {
|
|
_foo: T,
|
|
}
|
|
|
|
#[derive(FromQueryResult)]
|
|
struct MixedGenericTest<T: TryGetable + Clone, F>
|
|
where
|
|
F: TryGetable + Copy + Clone + 'static,
|
|
{
|
|
_foo: T,
|
|
_bar: F,
|
|
}
|
|
|
|
trait MyTrait {
|
|
type Item: TryGetable;
|
|
}
|
|
|
|
#[derive(FromQueryResult)]
|
|
struct TraitAssociateTypeTest<T>
|
|
where
|
|
T: MyTrait,
|
|
{
|
|
_foo: T::Item,
|
|
}
|