.args("--unshare-net \
--dev-bind / / \
--tmpfs /tmp \
- --die-with-parent".split(" "))
+ --die-with-parent".split(' '))
.arg(current_exe);
let (early, late) = {
let mut still_early = true;
env::args_os().skip(1)
.partition::<Vec<_>,_>(|s| {
- still_early &= early(&s);
+ still_early &= early(s);
still_early
})
};
let manifest_var = "CARGO_MANIFEST_DIR";
let src: String = (|| Ok::<_,AE>(match env::var(manifest_var) {
- Ok(dir) => dir.into(),
+ Ok(dir) => dir,
Err(env::VarError::NotPresent) => start_dir.clone(),
e@ Err(_) => throw!(e.context(manifest_var).err().unwrap()),
}))()
let exe = ds.subst("@target@/debug/otter")?;
let specs = self.subst("@src@/specs")?;
let mut args: Vec<String> = vec![];
- args.push("--config" .to_owned()); args.push(prctx.resolve(&CONFIG));
+ args.push("--config" .to_owned()); args.push(prctx.resolve(CONFIG));
args.push("--spec-dir".to_owned()); args.push(prctx.resolve(&specs) );
args.extend(xargs.to_args(ds));
let dbg = format!("running {} {:?}", &exe, &args);
if !opts.no_bwrap {
reinvoke_via_bwrap(
- &opts, ¤t_exe,
+ opts, ¤t_exe,
&mut |s: &OsStr| s.to_str().unwrap().starts_with("--test=")
)
.context("reinvoke via bwrap")?;
sleep(opts.pause.into());
let cln = cleanup_notify::Handle::new()?;
- let ds = prepare_tmpdir(&opts, ¤t_exe)?;
+ let ds = prepare_tmpdir(opts, ¤t_exe)?;
let (mgmt_conn, server_child) =
prepare_gameserver(&cln, &ds).did("setup game server")?;
-A clippy::manual_split_once
-A clippy::expect_fun_call
-A clippy::manual_map
+-A clippy::vec_init_then_push
+-A clippy::collapsible_if
const CT_JAVASCRIPT: mime::Mime = mime::APPLICATION_JAVASCRIPT_UTF_8;
const CT_TEXT: mime::Mime = mime::TEXT_PLAIN_UTF_8;
const CT_HTML: mime::Mime = mime::TEXT_HTML_UTF_8;
-const CT_ZIP: &'static str = "application/zip";
-const CT_GZIP: &'static str = "application/gzip";
-const CT_WASM: &'static str = "application/wasm";
+const CT_ZIP: &str = "application/zip";
+const CT_GZIP: &str = "application/gzip";
+const CT_WASM: &str = "application/wasm";
trait IntoMime: Debug {
fn into_mime(&self) -> mime::Mime;
enum ResourceLocation { Main, Wasm(&'static str), }
type RL = ResourceLocation;
-const RESOURCES: &[(&'static str, ResourceLocation, ConstContentType)] = &[
+const RESOURCES: &[(&str, ResourceLocation, ConstContentType)] = &[
("script.js", RL::Main, &CT_JAVASCRIPT),
("LICENCE", RL::Main, &CT_TEXT),
("libre", RL::Main, &CT_HTML),
.set_content_type(ctype.into_mime())
}
-const FILES_PATH: &'static str = "/_/src";
+const FILES_PATH: &str = "/_/src";
#[derive(Error)]
#[error("actix Files produced improper response: {0}")]
};
let for_piece = SessionPieceContext {
+ pos,
z: zlevel.clone(),
id: pri.vpid,
- pos: pos,
info: serde_json::to_string(&for_info)
.map_err(|e| InternalError::JSONEncode(e))?,
};
for libs in opts.libs.split(SPLIT) {
let tlibs = Config1::PathGlob(libs.to_owned());
- load_global_libs(&vec![tlibs.clone()])?;
+ load_global_libs(&[tlibs.clone()])?;
}
let mut items: Vec<ItemForOutput> = default();
let ig_dummy = Instance::dummy();