@@ -187,8 +187,7 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
187
187
. output ( )
188
188
. map_err ( |err| {
189
189
error ! ( "Failed to create interface. Error: {err}" ) ;
190
- let message = err. to_string ( ) ;
191
- WireguardInterfaceError :: ServiceInstallationFailed { err, message }
190
+ WireguardInterfaceError :: ServiceInstallationFailed ( err. to_string ( ) )
192
191
} ) ?;
193
192
194
193
debug ! ( "Done installing the new service. Service installation output: {service_installation_output:?}" , ) ;
@@ -198,10 +197,7 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
198
197
"Failed to install WireGuard tunnel as a Windows service: {:?}" ,
199
198
service_installation_output. stdout
200
199
) ;
201
- return Err ( WireguardInterfaceError :: ServiceInstallationFailed {
202
- err : io:: Error :: new ( io:: ErrorKind :: Other , "Cannot create service" ) ,
203
- message,
204
- } ) ;
200
+ return Err ( WireguardInterfaceError :: ServiceInstallationFailed ( message) ) ;
205
201
}
206
202
207
203
debug ! (
@@ -215,8 +211,7 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
215
211
. output ( )
216
212
. map_err ( |err| {
217
213
error ! ( "Failed to configure tunnel service. Error: {err}" ) ;
218
- let message = err. to_string ( ) ;
219
- WireguardInterfaceError :: ServiceInstallationFailed { err, message }
214
+ WireguardInterfaceError :: ServiceInstallationFailed ( err. to_string ( ) )
220
215
} ) ?;
221
216
222
217
debug ! ( "Done disabling automatic restart for the new service. Service update output: {service_update_output:?}" , ) ;
@@ -225,10 +220,7 @@ impl WireguardInterfaceApi for WGApi<Kernel> {
225
220
"Failed to configure WireGuard tunnel service: {:?}" ,
226
221
service_update_output. stdout
227
222
) ;
228
- return Err ( WireguardInterfaceError :: ServiceInstallationFailed {
229
- err : io:: Error :: new ( io:: ErrorKind :: Other , "Cannot configure service" ) ,
230
- message,
231
- } ) ;
223
+ return Err ( WireguardInterfaceError :: ServiceInstallationFailed ( message) ) ;
232
224
}
233
225
234
226
// TODO: set maximum transfer unit (MTU)
0 commit comments