let gs = &mut g.gs;
let ipieces = &g.ipieces;
let iplayers = &g.iplayers;
- let ipl = &iplayers.byid(player)?.ipl;
+ let _ = iplayers.byid(player)?;
let _ = gs.players.byid(player)?;
let lens = TransparentLens { };
let piece = lens.decode_visible_pieceid(form.piece, player);
#[throws(ApiPieceOpError)]
fn op(&self, a: ApiPieceOpArgs) -> PieceUpdateFromOp {
- let ApiPieceOpArgs { gs,player,piece,p,lens,iplayers, .. } = a;
+ let ApiPieceOpArgs { gs,player,piece,p,lens, .. } = a;
let gpl = gs.players.byid(player)?;
let pc = gs.pieces.byid_mut(piece)?;
let pcs = p.describe_pri(&lens.log_pri(piece, pc)).0;
impl ApiPieceOp for ApiPieceRaise {
#[throws(ApiPieceOpError)]
fn op(&self, a: ApiPieceOpArgs) -> PieceUpdateFromOp {
- let ApiPieceOpArgs { gs,player,piece,p,lens, .. } = a;
+ let ApiPieceOpArgs { gs,piece, .. } = a;
let pc = gs.pieces.byid_mut(piece).unwrap();
pc.zlevel = ZLevel { z : self.z.clone(), zg : gs.gen };
let update = PieceUpdateOp::SetZLevel(());
impl ApiPieceOp for ApiPieceMove {
#[throws(ApiPieceOpError)]
fn op(&self, a: ApiPieceOpArgs) -> PieceUpdateFromOp {
- let ApiPieceOpArgs { gs,player,piece,p,lens, .. } = a;
+ let ApiPieceOpArgs { gs,piece, .. } = a;
let pc = gs.pieces.byid_mut(piece).unwrap();
let (pos, clamped) = self.0.clamped(gs.table_size);
let logents = vec![];
let mut ag = AccountsGuard::lock();
let auth = authorise_for_account(cs, &ag, &account)?;
let access = access.map(Into::into);
- ag.with_entry_mut(&account, auth, access, |record, acctid|{
+ ag.with_entry_mut(&account, auth, access, |record, _acctid|{
fn update_from<T>(spec: Option<T>, record: &mut T) {
if let Some(new) = spec { *record = new; }
}
}
let y = match update {
- Noop { } => readonly(cs,ag,ig, &[], |ig| Ok(Fine))?,
+ Noop { } => readonly(cs,ag,ig, &[], |_| Ok(Fine))?,
Insn::SetTableSize(size) => {
let ig = cs.check_acl(ag, ig, PCH::Instance, &[TP::ChangePieces])?.0;
} => {
// todo some kind of permissions check for player too
let ig = cs.check_acl(ag, ig, PCH::Instance, &[TP::AddPlayer])?.0;
- let (record, acctid) = ag.lookup(&account)?;
+ let (_arecord, acctid) = ag.lookup(&account)?;
let nick = nick.ok_or(ME::ParameterMissing)?;
let logentry = LogEntry {
html: Html(format!("{} added a player: {}", &who,
RemovePlayer { player } => {
let ig = cs.check_acl_modify_player(ag, ig, player,
&[TP::RemovePlayer])?.0;
- let (gpl, ipl) = ig.player_remove(player)?;
+ let (gpl, _ipl) = ig.player_remove(player)?;
let show = if let Some(gpl) = gpl {
htmlescape::encode_minimal(&gpl.nick)
} else {
if_chain! {
if let Some(ipr) = ig.iplayers.get(player);
let ipl = &ipr.ipl;
- if let Ok((arecord, acctid)) = ag.lookup(ipl.acctid);
+ if let Ok((arecord, _)) = ag.lookup(ipl.acctid);
then { Ok((player, MgmtPlayerInfo {
account: (*arecord.account).clone(),
nick,
) -> (&'ig mut InstanceGuard<'ig>,
Authorisation<InstanceName>)
{
- let (ipl_unauth, gpl_unauth) = {
+ let ipl_unauth = {
let ig = ig.by(Authorisation::authorise_any());
- (ig.iplayers.byid(player)?, ig.gs.players.byid(player)?)
+ ig.iplayers.byid(player)?
};
let how = PCH::InstanceOrOnlyAffectedAccount(ipl_unauth.ipl.acctid);
let (ig, auth) = self.check_acl(ag, ig, how, p)?;
pub struct Authorisation<A> (PhantomData<A>);
impl<T> Authorisation<T> {
- pub const fn authorised(v: &T) -> Authorisation<T> {
+ pub const fn authorised(_v: &T) -> Authorisation<T> {
Authorisation(PhantomData)
}
- pub fn map<U>(self, f: fn(&T) -> &U) -> Authorisation<U> {
+ pub fn map<U>(self, _f: fn(&T) -> &U) -> Authorisation<U> {
self.therefore_ok()
}
pub fn therefore_ok<U>(self) -> Authorisation<U> {