@@ -2,6 +2,12 @@ use crate::connection_string::*;
2
2
3
3
pub struct ConnectionStringBuilder < ' a > ( ConnectionString < ' a > ) ;
4
4
5
+ impl < ' a > Default for ConnectionStringBuilder < ' a > {
6
+ fn default ( ) -> Self {
7
+ Self ( ConnectionString :: default ( ) )
8
+ }
9
+ }
10
+
5
11
impl < ' a > ConnectionStringBuilder < ' a > {
6
12
pub fn new ( ) -> Self {
7
13
Self ( ConnectionString :: default ( ) )
@@ -32,73 +38,48 @@ impl<'a> ConnectionStringBuilder<'a> {
32
38
) ) ;
33
39
}
34
40
if let Some ( endpoint_suffix) = self . 0 . endpoint_suffix {
35
- kv_pairs. push ( format ! (
36
- "{}={}" ,
37
- ENDPOINT_SUFFIX_KEY_NAME ,
38
- endpoint_suffix
39
- ) ) ;
41
+ kv_pairs. push ( format ! ( "{}={}" , ENDPOINT_SUFFIX_KEY_NAME , endpoint_suffix) ) ;
40
42
}
41
43
if let Some ( default_endpoints_protocol) = self . 0 . default_endpoints_protocol . as_ref ( ) {
42
44
kv_pairs. push ( format ! (
43
45
"{}={}" ,
44
- DEFAULT_ENDPOINTS_PROTOCOL_KEY_NAME ,
45
- default_endpoints_protocol
46
+ DEFAULT_ENDPOINTS_PROTOCOL_KEY_NAME , default_endpoints_protocol
46
47
) ) ;
47
48
}
48
49
if let Some ( blob_endpoint) = self . 0 . blob_endpoint {
49
- kv_pairs. push ( format ! (
50
- "{}={}" ,
51
- BLOB_ENDPOINT_KEY_NAME ,
52
- blob_endpoint
53
- ) ) ;
50
+ kv_pairs. push ( format ! ( "{}={}" , BLOB_ENDPOINT_KEY_NAME , blob_endpoint) ) ;
54
51
}
55
52
if let Some ( blob_secondary_endpoint) = self . 0 . blob_secondary_endpoint {
56
53
kv_pairs. push ( format ! (
57
54
"{}={}" ,
58
- BLOB_SECONDARY_ENDPOINT_KEY_NAME ,
59
- blob_secondary_endpoint
55
+ BLOB_SECONDARY_ENDPOINT_KEY_NAME , blob_secondary_endpoint
60
56
) ) ;
61
57
}
62
58
if let Some ( table_endpoint) = self . 0 . table_endpoint {
63
- kv_pairs. push ( format ! (
64
- "{}={}" ,
65
- TABLE_ENDPOINT_KEY_NAME ,
66
- table_endpoint
67
- ) ) ;
59
+ kv_pairs. push ( format ! ( "{}={}" , TABLE_ENDPOINT_KEY_NAME , table_endpoint) ) ;
68
60
}
69
61
if let Some ( table_secondary_endpoint) = self . 0 . table_secondary_endpoint {
70
62
kv_pairs. push ( format ! (
71
63
"{}={}" ,
72
- TABLE_SECONDARY_ENDPOINT_KEY_NAME ,
73
- table_secondary_endpoint
64
+ TABLE_SECONDARY_ENDPOINT_KEY_NAME , table_secondary_endpoint
74
65
) ) ;
75
66
}
76
67
if let Some ( queue_endpoint) = self . 0 . queue_endpoint {
77
- kv_pairs. push ( format ! (
78
- "{}={}" ,
79
- QUEUE_ENDPOINT_KEY_NAME ,
80
- queue_endpoint
81
- ) ) ;
68
+ kv_pairs. push ( format ! ( "{}={}" , QUEUE_ENDPOINT_KEY_NAME , queue_endpoint) ) ;
82
69
}
83
70
if let Some ( queue_secondary_endpoint) = self . 0 . queue_secondary_endpoint {
84
71
kv_pairs. push ( format ! (
85
72
"{}={}" ,
86
- QUEUE_SECONDARY_ENDPOINT_KEY_NAME ,
87
- queue_secondary_endpoint
73
+ QUEUE_SECONDARY_ENDPOINT_KEY_NAME , queue_secondary_endpoint
88
74
) ) ;
89
75
}
90
76
if let Some ( file_endpoint) = self . 0 . file_endpoint {
91
- kv_pairs. push ( format ! (
92
- "{}={}" ,
93
- FILE_ENDPOINT_KEY_NAME ,
94
- file_endpoint
95
- ) ) ;
77
+ kv_pairs. push ( format ! ( "{}={}" , FILE_ENDPOINT_KEY_NAME , file_endpoint) ) ;
96
78
}
97
79
if let Some ( file_secondary_endpoint) = self . 0 . file_secondary_endpoint {
98
80
kv_pairs. push ( format ! (
99
81
"{}={}" ,
100
- FILE_SECONDARY_ENDPOINT_KEY_NAME ,
101
- file_secondary_endpoint
82
+ FILE_SECONDARY_ENDPOINT_KEY_NAME , file_secondary_endpoint
102
83
) ) ;
103
84
}
104
85
0 commit comments