source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b"
+[[package]]
+name = "arrayvec"
+version = "0.7.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5a2f58b0bb10c380af2b26e57212856b8c9a59e0925b4c20f4a174a49734eaf7"
+
[[package]]
name = "ascii"
version = "1.0.0"
checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587"
dependencies = [
"arrayref",
- "arrayvec",
+ "arrayvec 0.5.2",
"constant_time_eq",
]
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "16cb54cd28cb3d2e964d9444ca185676a94fd9b7cce5f02b22c717947ed8e9a2"
dependencies = [
- "arrayvec",
+ "arrayvec 0.5.2",
]
[[package]]
name = "otter-base"
version = "0.5.1"
dependencies = [
- "arrayvec",
+ "arrayvec 0.7.0",
"derive_more",
"extend",
"fehler",
p.info["desc"] == otter::hand::UNCLAIMED_HAND_DESC
})
.map(|(i,_)| i)
- .collect::<ArrayVec<[_;1]>>()
+ .collect::<ArrayVec<_,1>>()
.into_inner().unwrap();
dbgc!(&hand);
.filter(|(_i,p)| p.info["desc"].as_str().unwrap().ends_with(" pawn"))
.map(|(i,_)| i)
.take(2)
- .collect::<ArrayVec<[_;2]>>()
+ .collect::<ArrayVec<_,2>>()
.into_inner().unwrap();
pawns.sort_by_key(|&p| -pieces[p].pos.x());
let pieces = session.pieces::<PIA>()?;
let llm = pieces.into_iter()
.filter(|pi| pi.info["desc"] == "a library load area marker")
- .collect::<ArrayVec<_>>();
+ .collect::<ArrayVec<_,2>>();
let llm: [_;2] = llm.into_inner().unwrap();
dbgc!(&llm);
let [alice, bob]: [Player; 2] =
su.ds.setup_static_users(&mut mc, default())?
.into_iter().map(|sus| Player { nick: sus.nick, url: sus.url })
- .collect::<ArrayVec<_>>().into_inner().unwrap();
+ .collect::<ArrayVec<_,2>>().into_inner().unwrap();
drop(mc);
let su_rc = Rc::new(RefCell::new(su));
[dependencies]
-arrayvec="0.5"
+arrayvec="0.7"
derive_more="0.99"
extend="1"
htmlescape="0.3"
#[throws(PosCFromIteratorError)]
pub fn from_iter<I: Iterator<Item=T>>(i: I) -> Self { PosC{ coords:
i
- .collect::<ArrayVec<_>>()
+ .collect::<ArrayVec<_,2>>()
.into_inner()
.map_err(|_| PosCFromIteratorError)?
}}
impl<T> PosC<T> where T: Debug {
pub fn from_iter_2<I: Iterator<Item=T>>(i: I) -> Self { PosC{ coords:
i
- .collect::<ArrayVec<_>>()
+ .collect::<ArrayVec<_,2>>()
.into_inner()
.unwrap()
}}
I: Iterator<Item=Result<T,E>>
>(i: I) -> Self { PosC{ coords:
i
- .collect::<Result<ArrayVec<_>,E>>()?
+ .collect::<Result<ArrayVec<_,2>,E>>()?
.into_inner().unwrap()
}}
}
pub fn timestring_abbreviate<'x>(base: &str, this: &'x str)
-> (&'x str, bool)
{
- fn split(s: &str) -> ArrayVec<[&str; 3]> {
+ fn split(s: &str) -> ArrayVec<&str, 3> {
s.splitn(3, ' ').collect()
}
let base3 = split(base);
Poor(insns,
"surplus marker(s) removed")
} else {
- let mut good: ArrayVec<_> = default();
+ let mut good: ArrayVec<_,2> = default();
for p in &markers {
good.push(p.visible.as_ref().ok_or_else(
|| anyhow!("library marker(s) with hidden position!")
#[throws(NotBundle)]
fn from_str(fleaf: &str) -> BundleSavefile {
let [lhs, rhs] = fleaf.splitn(2, '.')
- .collect::<ArrayVec<[&str;2]>>()
+ .collect::<ArrayVec<&str,2>>()
.into_inner().map_err(|_| "no dot")?;
let index = lhs.parse().map_err(|_| "bad index")?;
if rhs == "tmp" { return BundleSavefile::PreviousUploadFailed(index) }
URender { st, remaining, nick }
})
- .collect::<ArrayVec<_>>()
+ .collect::<ArrayVec<_,2>>()
.into_inner().unwrap();
if r.iter().filter(|ur| ur.st == URS::Reset).count() == 1 {
Rect { corners: self.bbox_approx()?.corners.iter().map(
|c| *c + p.pos
)
- .collect::<Result<ArrayVec<_>,_>>()?
+ .collect::<Result<ArrayVec<_,2>,_>>()?
.into_inner().unwrap() }
}
}
access
};
- let current_tokens: ArrayVec<[&RawToken;2]> = {
+ let current_tokens: ArrayVec<&RawToken,2> = {
let players = GLOBAL.players.read();
self.tokens_players.tr.iter().
filter(|&token| (||{
})
.cycle()
.take(2)
- .collect::<ArrayVec<[_;2]>>()
+ .collect::<ArrayVec<_,2>>()
.into_inner()
.unwrap()
} else {
}.iter().cloned().zip(&scale).map(|(size,scale)| {
size * 0.5 / scale
})
- .collect::<ArrayVec<[_;2]>>()
+ .collect::<ArrayVec<_,2>>()
.into_inner()
.unwrap()
}))?;
[-1,1].iter().map(|&signum| Ok::<_,CoordinateOverflow>({
(centre + (offset * signum)?)?
}))
- .collect::<Result<ArrayVec<_>,_>>()?
+ .collect::<Result<ArrayVec<_,2>,_>>()?
.into_inner().unwrap()
};
rect
pub fn map<U, F: FnMut(&T) -> U>(&self, f: F) -> OldNew<U> {
OldNew(
self.iter().map(f)
- .collect::<ArrayVec<[U; 2]>>()
+ .collect::<ArrayVec<U,2>>()
.into_inner()
.unwrap_or_else(|_|panic!())
)
pub fn as_refs(&self) -> OldNew<&T> {
OldNew(
self.iter()
- .collect::<ArrayVec<[&T; 2]>>()
+ .collect::<ArrayVec<&T,2>>()
.into_inner()
.unwrap_or_else(|_|panic!())
)