LHFJRWTGGRH2RGXEHE35U3WHVCNNUU25PKWT3BA2ICOLMUWRSDYAC
PEZZUG3QITDR5JYBRGMMM6H7J6UX4A4Y5CHKJPQSBHSQDBTQXKSQC
HMOBTVJ4FEPZWMUV2JDPZYH3EFCW6ED5M6KKNKQJQZVKTDAKTVFQC
5OUVESUQDAEU3PEYFDXDMEULBNBJYEEHWV2LWFOOUKCTKRSZQMSAC
5Y7ZXB53EMG34VZI5VQIZ77TZKBB4V6BGIILFZ5ZY73QYK4V2YHQC
QEKHTVB7CH754NUMHJ3AKVGRNKW3KOAKMALS7B3ZNKCUEH6GP4HQC
LLFG625ISXV7P2LUOFUMFIM5V5RJDKWCL47XX43X2CGILVAUQPVQC
MFGAW2Q2U6VB7A5H2OIYSX7JGB5FYSSBXWPPC5P5HCXKGWKLUEGQC
AV73DYWQ2UVZJYTN3UIW3TDMWNAETLXZRD7VHKTQLFQGHKJ5KI6QC
YCWYAX6K2DJKT7FO4IAYL6HJOIJLYFKAPGLFJ5XMYSYAS42LP3FQC
LPVC545KD6R5KNOTDPFDOD5FVA3KFBZARKVOLLXJXW3YK3RMNZKQC
pub fn depths<I: IntoIterator<Item = (usize, usize)>>(
preferences: I,
) -> Vec<usize> {
for (better, worse) in preferences {
}
}
let mut stack: Vec<(usize, Option<usize>)> =
while let Some((i, r)) = stack.pop() {
if !d.is_empty() {
stack.push((i, r));
for j in d {
stack.push((j, Some(i)));
}
} else if let Some(s) = r {
}
}
}
descent.into_iter().map(|d| d.len()).collect()
let e: HashSet<_> =
once(i).chain(descent[i].iter().copied()).collect();
descent[s].extend(e);
let d = std::mem::take(&mut dag[i]);
(0..dag.len()).rev().map(|x| (x, None)).collect();
dag[worse].push(better);
while dag.len() <= worse {
dag.push(Vec::new());
descent.push(HashSet::new());
let mut dag = Vec::new();
let mut descent = Vec::new();
use std::collections::HashSet;
use std::iter::once;
// If this task fails the worst that will happen is I compare more
// names than I otherwise would. .
let check =
tokio::spawn(async move {
let prefs =
pdb.list_preferences().await.unwrap_or_else(|_| Vec::new());
tokio::task::spawn_blocking(move || {
depths(prefs.into_iter().map(|(better, worse)| {
(better as usize, worse as usize)
}))
})
.await
.unwrap_or_else(|_| Vec::new())
});
pub async fn list_preferences(&self) -> DynResult<Vec<(i64, i64)>> {
self.post(|conn| {
let mut stmnt =
conn.prepare("SELECT better, worse FROM preferences")?;
let mut rows = Vec::new();
while let sqlite::State::Row = stmnt.next()? {
rows.push((stmnt.read::<i64>(0)?, stmnt.read::<i64>(1)?));
}
Ok(rows)
})
.await?
}
[[package]]
name = "convert_case"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e"
name = "rustc_version"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
"semver 1.0.4",
]
[[package]]