@@ -119,37 +119,37 @@ def faraday_ssl(options)
119119 return options [ :ssl ] if options [ :ssl ]
120120
121121 ssl = options [ :options ]
122- if ssl [ :verify_ssl ] || ssl [ :ssl_cert_store ]
123- {
124- verify : ssl [ :verify_ssl ] != OpenSSL :: SSL :: VERIFY_NONE ,
125- cert_store : ssl [ :ssl_cert_store ] ,
126- }
127- end
122+ return unless ssl [ :verify_ssl ] || ssl [ :ssl_cert_store ]
123+
124+ {
125+ verify : ssl [ :verify_ssl ] != OpenSSL :: SSL :: VERIFY_NONE ,
126+ cert_store : ssl [ :ssl_cert_store ] ,
127+ }
128128 end
129129
130130 # Helper function to evalueate the low level headers option
131131 def faraday_headers ( options )
132132 return options [ :headers ] if options [ :headers ]
133133
134134 headers = options [ :credentials ]
135- if headers [ :token ]
136- {
137- Authorization : 'Bearer ' + headers [ :token ] . to_s ,
138- }
139- end
135+ return unless headers && headers [ :token ]
136+
137+ {
138+ Authorization : 'Bearer ' + headers [ :token ] . to_s ,
139+ }
140140 end
141141
142142 # Helper function to evalueate the low level headers option
143143 def faraday_request ( options )
144144 return options [ :request ] if options [ :request ]
145145
146146 request = options [ :options ]
147- if request [ :open_timeout ] || request [ :timeout ]
148- {
149- open_timeout : request [ :open_timeout ] ,
150- timeout : request [ :timeout ] ,
151- }
152- end
147+ return unless request [ :open_timeout ] || request [ :timeout ]
148+
149+ {
150+ open_timeout : request [ :open_timeout ] ,
151+ timeout : request [ :timeout ] ,
152+ }
153153 end
154154
155155 # Helper function to create the args for the low level client
0 commit comments