Skip to content

Commit 4cf8f63

Browse files
committed
refactor: Replace StopConfigSer with wit-generated struct
1 parent c6410f4 commit 4cf8f63

1 file changed

Lines changed: 2 additions & 14 deletions

File tree

fly-http/src/machine.rs

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ pub(crate) mod ser {
7676
init: Option<InitConfigSer>,
7777
env: Option<HashMap<String, String>>,
7878
restart: Option<MachineRestartSer>,
79-
stop_config: Option<StopConfigSer>,
79+
stop_config: Option<StopConfig>,
8080
mounts: Option<Vec<Mount>>,
8181
}
8282

@@ -155,12 +155,6 @@ pub(crate) mod ser {
155155
}
156156
}
157157

158-
#[derive(Serialize, Deserialize, Debug)]
159-
pub(crate) struct StopConfigSer {
160-
signal: Option<String>,
161-
timeout: Option<u64>,
162-
}
163-
164158
#[derive(Serialize, Deserialize, Debug)]
165159
pub(crate) struct MountSer {
166160
volume: String,
@@ -299,20 +293,14 @@ pub(crate) mod ser {
299293
tty: i.tty,
300294
});
301295

302-
// Transform the stop config.
303-
let stop_config = wit.stop_config.map(|s| StopConfigSer {
304-
signal: s.signal,
305-
timeout: s.timeout,
306-
});
307-
308296
MachineConfigSer {
309297
image: wit.image,
310298
auto_destroy: wit.auto_destroy,
311299
env,
312300
guest,
313301
restart,
314302
init,
315-
stop_config,
303+
stop_config: wit.stop_config,
316304
mounts: wit.mounts,
317305
}
318306
}

0 commit comments

Comments
 (0)