File tree Expand file tree Collapse file tree 5 files changed +16
-18
lines changed Expand file tree Collapse file tree 5 files changed +16
-18
lines changed Original file line number Diff line number Diff line change @@ -34,19 +34,19 @@ impl ToPyObject for Result {
34
34
fn to_object ( & self , py : Python ) -> PyObject {
35
35
let dict = PyDict :: new ( py) ;
36
36
37
- dict. set_item ( "email" , self . email . to_object ( py ) ) . unwrap ( ) ;
38
- dict. set_item ( "has_valid_syntax" , self . has_valid_syntax . to_object ( py ) )
37
+ dict. set_item ( "email" , self . email . clone ( ) ) . unwrap ( ) ;
38
+ dict. set_item ( "has_valid_syntax" , self . has_valid_syntax )
39
39
. unwrap ( ) ;
40
40
if let Some ( mx) = self . mx . as_ref ( ) {
41
- dict. set_item ( "mx" , mx. to_object ( py ) ) . unwrap ( )
41
+ dict. set_item ( "mx" , mx) . unwrap ( )
42
42
}
43
43
if let Some ( misc) = self . misc . as_ref ( ) {
44
- dict. set_item ( "misc" , misc. to_object ( py ) ) . unwrap ( )
44
+ dict. set_item ( "misc" , misc) . unwrap ( )
45
45
}
46
46
if let Some ( smtp) = self . smtp . as_ref ( ) {
47
- dict. set_item ( "smtp" , smtp. to_object ( py ) ) . unwrap ( )
47
+ dict. set_item ( "smtp" , smtp) . unwrap ( )
48
48
}
49
- dict. to_object ( py )
49
+ dict. into ( )
50
50
}
51
51
}
52
52
#[ pyfunction]
Original file line number Diff line number Diff line change @@ -45,13 +45,11 @@ impl Misc {
45
45
impl ToPyObject for Misc {
46
46
fn to_object ( & self , py : Python ) -> PyObject {
47
47
let dict = PyDict :: new ( py) ;
48
- dict. set_item ( "is_disposable" , self . is_disposable . to_object ( py) )
48
+ dict. set_item ( "is_disposable" , self . is_disposable ) . unwrap ( ) ;
49
+ dict. set_item ( "is_free" , self . is_free ) . unwrap ( ) ;
50
+ dict. set_item ( "is_role_account" , self . is_role_account )
49
51
. unwrap ( ) ;
50
- dict. set_item ( "is_free" , self . is_free . to_object ( py) )
51
- . unwrap ( ) ;
52
- dict. set_item ( "is_role_account" , self . is_role_account . to_object ( py) )
53
- . unwrap ( ) ;
54
- dict. to_object ( py)
52
+ dict. into ( )
55
53
}
56
54
}
57
55
Original file line number Diff line number Diff line change @@ -22,11 +22,11 @@ impl Mx {
22
22
impl ToPyObject for Mx {
23
23
fn to_object ( & self , py : Python ) -> PyObject {
24
24
let dict = PyDict :: new ( py) ;
25
- dict. set_item ( "has_mx_records" , self . has_mx_records . to_object ( py ) )
25
+ dict. set_item ( "has_mx_records" , self . has_mx_records )
26
26
. unwrap ( ) ;
27
- dict. set_item ( "mx_records" , self . mx_records . to_object ( py ) )
27
+ dict. set_item ( "mx_records" , self . mx_records . clone ( ) )
28
28
. unwrap ( ) ;
29
- dict. to_object ( py )
29
+ dict. into ( )
30
30
}
31
31
}
32
32
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ impl Settings {
33
33
let from_email =
get_string_from_env ( "FROM_EMAIL" , "[email protected] " ) ;
34
34
let hello_name = get_string_from_env ( "HELLO_NAME" , "localhost" ) ;
35
35
let smtp_port = get_int_from_env ( "SMTP_PORT" , 25 ) ;
36
- let smtp_timeout = get_int_from_env ( "SMTP_TIMEOUT" , 10 ) ;
36
+ let smtp_timeout = get_int_from_env ( "SMTP_TIMEOUT" , 5 ) ;
37
37
let check_smtp = match std:: env:: var ( "CHECK_SMTP" ) {
38
38
Ok ( val) => val == "true" ,
39
39
Err ( _) => false ,
Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ impl Smtp {
25
25
impl ToPyObject for Smtp {
26
26
fn to_object ( & self , py : Python ) -> PyObject {
27
27
let dict = PyDict :: new ( py) ;
28
- dict. set_item ( "is_deliverable" , self . is_deliverable . to_object ( py ) )
28
+ dict. set_item ( "is_deliverable" , self . is_deliverable )
29
29
. unwrap ( ) ;
30
- dict. to_object ( py )
30
+ dict. into ( )
31
31
}
32
32
}
33
33
impl Smtp {
You can’t perform that action at this time.
0 commit comments