From: Ian Jackson Date: Sun, 2 May 2021 09:54:01 +0000 (+0100) Subject: bundles: Introduce and use Kind::only X-Git-Tag: otter-0.6.0~471 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=84ecb9286fea264e7ff6826cc5c95f584cb45e3a;p=otter.git bundles: Introduce and use Kind::only Signed-off-by: Ian Jackson --- diff --git a/src/bin/otter.rs b/src/bin/otter.rs index f96bf542..ce57ceab 100644 --- a/src/bin/otter.rs +++ b/src/bin/otter.rs @@ -1346,7 +1346,7 @@ mod upload_bundle { io::copy(&mut f, &mut dw).context("read bundle file (for hash)")?; dw.finish().0 }; - let kind = bundles::Kind::Zip; + let kind = bundles::Kind::only(); f.seek(io::SeekFrom::Start(0)).context("rewind bundle file")?; let cmd = MC::UploadBundle { game: instance_name.clone(), diff --git a/src/bundles.rs b/src/bundles.rs index 9e86f35b..70f30061 100644 --- a/src/bundles.rs +++ b/src/bundles.rs @@ -17,6 +17,7 @@ pub enum Kind { #[strum(to_string="zip")] Zip, // #[strum(to_string="game.toml")] GameSpec, // identification problems } +impl Kind { pub fn only() -> Self { Kind::Zip } } pub type Index = u16; const BUNDLES_MAX: Index = 64;