File tree Expand file tree Collapse file tree 3 files changed +24
-8
lines changed
Expand file tree Collapse file tree 3 files changed +24
-8
lines changed Original file line number Diff line number Diff line change @@ -186,7 +186,13 @@ impl Server {
186186 ) ) ;
187187 }
188188
189- if self . attributes . get ( & attribute) . as_array ( ) . unwrap ( ) . contains ( & value) {
189+ if self
190+ . attributes
191+ . get ( & attribute)
192+ . as_array ( )
193+ . unwrap ( )
194+ . contains ( & value)
195+ {
190196 return Ok ( self ) ;
191197 }
192198
@@ -220,7 +226,13 @@ impl Server {
220226 ) ) ;
221227 }
222228
223- if !self . attributes . get ( & attribute) . as_array ( ) . unwrap ( ) . contains ( & value) {
229+ if !self
230+ . attributes
231+ . get ( & attribute)
232+ . as_array ( )
233+ . unwrap ( )
234+ . contains ( & value)
235+ {
224236 return Ok ( self ) ;
225237 }
226238
Original file line number Diff line number Diff line change @@ -7,10 +7,10 @@ use signature::Signer;
77
88use crate :: API_VERSION ;
99
10- pub const ENV_NAME_BASE_URL : & ' static str = "SERVERADMIN_BASE_URL" ;
11- pub const ENV_NAME_TOKEN : & ' static str = "SERVERADMIN_TOKEN" ;
12- pub const ENV_NAME_KEY_PATH : & ' static str = "SERVERADMIN_KEY_PATH" ;
13- pub const ENV_NAME_SSH_AGENT : & ' static str = "SSH_AUTH_SOCK" ;
10+ pub const ENV_NAME_BASE_URL : & str = "SERVERADMIN_BASE_URL" ;
11+ pub const ENV_NAME_TOKEN : & str = "SERVERADMIN_TOKEN" ;
12+ pub const ENV_NAME_KEY_PATH : & str = "SERVERADMIN_KEY_PATH" ;
13+ pub const ENV_NAME_SSH_AGENT : & str = "SSH_AUTH_SOCK" ;
1414
1515#[ derive( Clone , Debug , Default ) ]
1616pub struct Config {
Original file line number Diff line number Diff line change @@ -23,7 +23,10 @@ impl NewObject {
2323 } )
2424 }
2525
26- pub async fn get_or_create ( servertype : impl ToString , hostname : impl ToString ) -> anyhow:: Result < Self > {
26+ pub async fn get_or_create (
27+ servertype : impl ToString ,
28+ hostname : impl ToString ,
29+ ) -> anyhow:: Result < Self > {
2730 let mut new_object = Self :: request_new ( servertype) . await ?;
2831
2932 if let Ok ( server) = Query :: builder ( )
@@ -32,7 +35,8 @@ impl NewObject {
3235 . build ( )
3336 . request ( )
3437 . await ?
35- . one ( ) {
38+ . one ( )
39+ {
3640 new_object. object_id = Some ( server. object_id ) ;
3741 new_object. attributes = server. attributes ;
3842 }
You can’t perform that action at this time.
0 commit comments