MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / serialize_structymap

Function serialize_structymap

battlecode-engine/src/world.rs:84–86  ·  view source on GitHub ↗

fuckin garbage no-good nonsense my goodnus

(map: &StructyMap, s: S)

Source from the content-addressed store, hash-verified

82
83// fuckin garbage no-good nonsense my goodnus
84fn serialize_structymap<S: Serializer> (map: &StructyMap, s: S) -> Result<S::Ok, S::Error> {
85 map.iter().map(|(a,b)| (a.clone(),b.clone())).collect::<Vec<(_,_)>>().serialize(s)
86}
87fn deserialize_structymap<'de, D: Deserializer<'de>>(d: D) -> Result<StructyMap, D::Error> {
88 let vec = <Vec<(MapLocation, UnitID)>>::deserialize(d)?;
89 let mut map = StructyMap::default();

Callers

nothing calls this directly

Calls 2

serializeMethod · 0.80
cloneMethod · 0.80

Tested by

no test coverage detected