chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3142fd9
)
bundles: Do not use ArrayVec to unpack a possibly-too-long thing
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 18 May 2021 19:11:51 +0000
(20:11 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Tue, 18 May 2021 19:12:31 +0000
(20:12 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
src/bundles.rs
patch
|
blob
|
history
diff --git
a/src/bundles.rs
b/src/bundles.rs
index 09e06e6160b9dcdad7c58e87f0a8a7e725368b95..6a58e84d458873b85d1a0e0526d73fbe141c58f9 100644
(file)
--- a/
src/bundles.rs
+++ b/
src/bundles.rs
@@
-548,9
+548,10
@@
fn parse_bundle<EH>(id: Id, instance: &InstanceName, file: File, eh: EH,
let mut libs = Vec::new();
for (name,i) in &za {
eh.besteffort(|| Ok::<_,LE>(if_chain!{
- if let Ok([dir, file]) = name.as_ref().split('/')
- .collect::<ArrayVec<[&str;2]>>()
- .into_inner();
+ let mut split = name.as_ref().split('/');
+ 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");