From: Ian Jackson Date: Mon, 8 Mar 2021 23:57:06 +0000 (+0000) Subject: PieceTrait: make it 'static X-Git-Tag: otter-0.4.0~205 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=514d0f120d7ceba81b096b397de91a947e856271;p=otter.git PieceTrait: make it 'static We don't want any non-'static and this is needed for dyn_upcast which we want. Signed-off-by: Ian Jackson --- diff --git a/src/gamestate.rs b/src/gamestate.rs index 89450282..ea6ca7e9 100644 --- a/src/gamestate.rs +++ b/src/gamestate.rs @@ -132,7 +132,7 @@ pub struct UoDescription { } #[typetag::serde] // usual variable: p -pub trait PieceTrait: OutlineTrait + Send + Debug { +pub trait PieceTrait: OutlineTrait + Send + Debug + 'static { /// by convention, occult face is nfaces-1 // xxx this is no good, we need a central definition of the occult // face to avoid weird behaviour with buggy gamespecs @@ -365,7 +365,7 @@ impl PieceRenderInstructions { #[throws(IE)] pub fn make_defs<'p,P>(&self, gpc: &GPiece, p: &P) -> Html - where P:Borrow + where P:Borrow { #[throws(IE)] fn inner(pri: &PieceRenderInstructions, gpc: &GPiece, p: &dyn PieceTrait) @@ -394,7 +394,7 @@ impl PieceRenderInstructions { } pub fn describe<'p,P>(&self, gpc: &GPiece, p: &P) -> Html - where P:Borrow + where P:Borrow { fn inner(pri: &PieceRenderInstructions, gpc: &GPiece, p: &dyn PieceTrait) -> Html diff --git a/src/hidden.rs b/src/hidden.rs index d63002f8..037c3580 100644 --- a/src/hidden.rs +++ b/src/hidden.rs @@ -445,7 +445,7 @@ pub use vpid::{PerPlayerIdMap, NotchNumber, Notch, Notches}; // ========== public entrypoints ========== /// None => do not render at all -pub fn piece_pri<'p, P:Borrow>( +pub fn piece_pri>( occults: &GameOccults, player: PlayerId, gpl: &mut GPlayer, piece: PieceId, gpc: &GPiece, p: &P,