chiark / gitweb /
bundles: Refactor slightly to make room for specs
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 19 May 2021 23:15:25 +0000 (00:15 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 20 May 2021 00:40:55 +0000 (01:40 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bundles.rs

index 0bca4eab323eb4360bead7dce863a370033cf4cc..b21835326cf8a78e7c8614f151522eef6758dede 100644 (file)
@@ -552,15 +552,18 @@ fn parse_bundle<EH>(id: Id, instance: &InstanceName, file: File, eh: EH,
       if let Some(dir)  = split.next();
       if let Some(file) = split.next();
       if let None       = split.next();
-      if unicase::eq(dir, "library");
-      if let Some((base, ext)) = file.rsplit_once('.');
-      if unicase::eq(ext, "toml");
       then {
-        libs.push(LibScanned {
-          dir_inzip: format!("{}/{}", &dir, &base),
-          libname: base.to_lowercase(),
-          inzip: i,
-        });
+        if unicase::eq(dir, "library") { if_chain!{
+          if let Some((base, ext)) = file.rsplit_once('.');
+          if unicase::eq(ext, "toml");
+          then {
+            libs.push(LibScanned {
+              dir_inzip: format!("{}/{}", &dir, &base),
+              libname: base.to_lowercase(),
+              inzip: i,
+            });
+          }
+        }}
       }
     }), ||())?;
   }