chiark / gitweb /
bundles: Introduce and use Kind::only
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 May 2021 09:54:01 +0000 (10:54 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 2 May 2021 09:54:01 +0000 (10:54 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bin/otter.rs
src/bundles.rs

index f96bf5427263058c3f9ce05d9104c25fafe191af..ce57ceaba38e3b9f0b5200176240f604453c1ddd 100644 (file)
@@ -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(),
index 9e86f35b2aa584dd9a8e4c4dfb55ef795305a66b..70f3006143cd9a3d98949df1e9228f61a106d73b 100644 (file)
@@ -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;