@@ -9,17 +9,17 @@ use std::fmt::{self, Write};
9
9
/// A tuple of arguments to be sent to the database.
10
10
// This lint is designed for general collections, but `Arguments` is not meant to be as such.
11
11
#[ allow( clippy:: len_without_is_empty) ]
12
- pub trait Arguments < ' q > : Send + Sized + Default {
12
+ pub trait Arguments : Send + Sized + Default {
13
13
type Database : Database ;
14
14
15
15
/// Reserves the capacity for at least `additional` more values (of `size` total bytes) to
16
16
/// be added to the arguments without a reallocation.
17
17
fn reserve ( & mut self , additional : usize , size : usize ) ;
18
18
19
19
/// Add the value to the end of the arguments.
20
- fn add < T > ( & mut self , value : T ) -> Result < ( ) , BoxDynError >
20
+ fn add < ' t , T > ( & mut self , value : T ) -> Result < ( ) , BoxDynError >
21
21
where
22
- T : ' q + Encode < ' q , Self :: Database > + Type < Self :: Database > ;
22
+ T : Encode < ' t , Self :: Database > + Type < Self :: Database > ;
23
23
24
24
/// The number of arguments that were already added.
25
25
fn len ( & self ) -> usize ;
@@ -29,19 +29,17 @@ pub trait Arguments<'q>: Send + Sized + Default {
29
29
}
30
30
}
31
31
32
- pub trait IntoArguments < ' q , DB : Database > : Sized + Send {
33
- fn into_arguments ( self ) -> <DB as Database >:: Arguments < ' q > ;
32
+ pub trait IntoArguments < DB : Database > : Sized + Send {
33
+ fn into_arguments ( self ) -> <DB as Database >:: Arguments ;
34
34
}
35
35
36
36
// NOTE: required due to lack of lazy normalization
37
37
#[ macro_export]
38
38
macro_rules! impl_into_arguments_for_arguments {
39
39
( $Arguments: path) => {
40
- impl <' q>
41
- $crate:: arguments:: IntoArguments <
42
- ' q,
43
- <$Arguments as $crate:: arguments:: Arguments <' q>>:: Database ,
44
- > for $Arguments
40
+ impl
41
+ $crate:: arguments:: IntoArguments <<$Arguments as $crate:: arguments:: Arguments >:: Database >
42
+ for $Arguments
45
43
{
46
44
fn into_arguments( self ) -> $Arguments {
47
45
self
@@ -51,13 +49,10 @@ macro_rules! impl_into_arguments_for_arguments {
51
49
}
52
50
53
51
/// used by the query macros to prevent supernumerary `.bind()` calls
54
- pub struct ImmutableArguments < ' q , DB : Database > ( pub <DB as Database >:: Arguments < ' q > ) ;
52
+ pub struct ImmutableArguments < DB : Database > ( pub <DB as Database >:: Arguments ) ;
55
53
56
- impl < ' q , DB : Database > IntoArguments < ' q , DB > for ImmutableArguments < ' q , DB > {
57
- fn into_arguments ( self ) -> <DB as Database >:: Arguments < ' q > {
54
+ impl < DB : Database > IntoArguments < DB > for ImmutableArguments < DB > {
55
+ fn into_arguments ( self ) -> <DB as Database >:: Arguments {
58
56
self . 0
59
57
}
60
58
}
61
-
62
- // TODO: Impl `IntoArguments` for &[&dyn Encode]
63
- // TODO: Impl `IntoArguments` for (impl Encode, ...) x16
0 commit comments