From e55360d0a93d6d242b652075f31518b5a19f5527 Mon Sep 17 00:00:00 2001 From: David Ross Date: Thu, 16 Aug 2018 00:07:10 -0700 Subject: [PATCH] Work around https://github.com/rust-lang/rust/issues/53140 Fixes https://github.com/daboross/screeps-in-rust-via-wasm/issues/14. --- screeps-game-api/src/objects/impls/construction_site.rs | 5 ++++- screeps-game-api/src/objects/impls/room_position.rs | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/screeps-game-api/src/objects/impls/construction_site.rs b/screeps-game-api/src/objects/impls/construction_site.rs index 05a34011..74e666c7 100644 --- a/screeps-game-api/src/objects/impls/construction_site.rs +++ b/screeps-game-api/src/objects/impls/construction_site.rs @@ -1,6 +1,9 @@ use stdweb::unstable::TryInto; -use {ConstructionSite, ReturnCode, StructureType}; +use {ReturnCode, StructureType}; + +// TODO: Use root import after https://github.com/rust-lang/rust/issues/53140 is fixed. +use super::super::ConstructionSite; simple_accessors! { ConstructionSite; diff --git a/screeps-game-api/src/objects/impls/room_position.rs b/screeps-game-api/src/objects/impls/room_position.rs index 1c39366e..30672c4d 100644 --- a/screeps-game-api/src/objects/impls/room_position.rs +++ b/screeps-game-api/src/objects/impls/room_position.rs @@ -4,9 +4,12 @@ use stdweb::unstable::TryInto; use { Color, Direction, FindConstant, HasPosition, LocalRoomPosition, LookConstant, ReturnCode, - RoomPosition, StructureType, + StructureType, }; +// TODO: Use root import after https://github.com/rust-lang/rust/issues/53140 is fixed. +use super::super::RoomPosition; + impl RoomPosition { pub fn new(x: u8, y: u8, room_name: &str) -> Self { js_unwrap!(new RoomPosition(@{x}, @{y}, @{room_name}))