impl MainOpts {
pub fn game(&self) -> &str {
- self.game.as_ref().map(|s| s.as_str()).unwrap_or_else(||{
+ self.game.as_deref().unwrap_or_else(||{
eprintln!(
"game (table) name not specified; pass --game option");
exit(EXIT_USAGE);
}
pub fn instance(&self) -> InstanceName {
- match self.game().strip_prefix(":") {
+ match self.game().strip_prefix(':') {
Some(rest) => {
InstanceName {
account: self.account.clone(),
-> Vec<MGI> {
let TableSpec { players, player_perms, acl, links } = spec;
let mut player_perms = player_perms.clone()
- .unwrap_or(PLAYER_DEFAULT_PERMS.iter().cloned().collect());
+ .unwrap_or_else(|| PLAYER_DEFAULT_PERMS.iter().cloned().collect());
player_perms.extend(PLAYER_ALWAYS_PERMS.iter());
let acl: RawAcl<_> =
-A clippy::manual_map
-A clippy::vec_init_then_push
-A clippy::collapsible_if
+-A clippy::iter_nth_zero
// OTTER_JST_LOWER_ONLY=exhaustive-05
+#![allow(clippy::or_fun_call)]
+#![allow(clippy::unnecessary_operation)] // trips on #[throws(Explode)]
+
use otter_nodejs_tests::*;
pub type Vpid = VisiblePieceId;
id, new_z, old_z, updated,
heavy: start.heavy(),
target: self.targets.contains(&id),
- zupd: start.zupd.into(),
+ zupd: start.zupd,
}
}).collect_vec();
p.zupd.show(),
zl.show());
};
- pr(o, &o.old_z); print!(" ");
- pr(n, &n.new_z); println!("");
+ pr(o, o.old_z); print!(" ");
+ pr(n, n.new_z); println!("");
}
// light targets are in same stacking order as before
tests.finish()?;
}
-static TEMPLATE: &'static str = r#"
+static TEMPLATE: &str = r#"
console.log('-------------------- {{ name }} --------------------')
jstest_did = fs.openSync('{{ name }}.did', 'w');
// SPDX-License-Identifier: AGPL-3.0-or-later
// There is NO WARRANTY.
+#![allow(clippy::or_fun_call)]
+#![allow(clippy::unnecessary_operation)] // trips on #[throws(Explode)]
+
pub use otter::imports::*;
pub use otter::prelude::*;
// SPDX-License-Identifier: AGPL-3.0-or-later
// There is NO WARRANTY.
+#![allow(clippy::or_fun_call)]
+#![allow(clippy::unnecessary_operation)] // trips on #[throws(Explode)]
+
pub use otter_api_tests::*;
pub use otter_api_tests as apitest;
].iter().cloned().collect();
caps.add("prefs", prefs)?;
caps.add("stdio", "inherit")?;
- let mut driver = t4::WebDriver::new("http://localhost:4444", &caps)
+ let driver = t4::WebDriver::new("http://localhost:4444", &caps)
.context("create 34 WebDriver")?;
const FRONT: &str = "front";
- let mut js_logfile = JsLogfileImp::open(&ds, FRONT)?;
+ let mut js_logfile = JsLogfileImp::open(ds, FRONT)?;
driver.set_window_name(FRONT).context("set initial window name")?;
- screenshot(&mut driver, &mut count, "startup", log::Level::Trace)?;
+ screenshot(&driver, &mut count, "startup", log::Level::Trace)?;
driver.get(URL).context("navigate to front page")?;
- screenshot(&mut driver, &mut count, "front", log::Level::Trace)?;
+ screenshot(&driver, &mut count, "front", log::Level::Trace)?;
js_logfile.fetch(&driver)?;
let js_logs = vec![Rc::new(RefCell::new(js_logfile))];
let elemid = format!("use{}", &pieceid);
let elem = self.su.driver.find_element(By::Id(&elemid))?;
PieceElement {
- elem,
- pieceid: pieceid.clone(),
+ elem, pieceid,
w: self,
}
}
dbg!(log)
}
- inner(&self, &mut move |s| ignore_before.matches(s))?
+ inner(self, &mut move |s| ignore_before.matches(s))?
}
#[throws(AE)]