chiark
/
gitweb
/
~ianmdlvl
/
otter.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
593360e
)
api: Replace open-coded calculation with call to fully_visible
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 18 Apr 2022 12:01:34 +0000
(13:01 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Mon, 18 Apr 2022 12:01:34 +0000
(13:01 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
daemon/api.rs
patch
|
blob
|
history
diff --git
a/daemon/api.rs
b/daemon/api.rs
index 94092cb3473b04d5a096032eda1b2ee26498bbf1..c5e0850f6b8e6af4f98af03792cdc9eba86cb7f8 100644
(file)
--- a/
daemon/api.rs
+++ b/
daemon/api.rs
@@
-582,13
+582,7
@@
api_route!{
piece, gs.pieces.byid(piece)?,
ipc)
.ok_or(Ia::PieceGone)?;
- let y = {
- use PriOG::*;
- match pri.occulted {
- Visible(y) => y,
- Occulted | Displaced(..) => throw!(Ia::Occultation),
- }
- };
+ let y = pri.fully_visible().ok_or(Ia::Occultation)?;
'_normal_global_ops__not_loop: loop {
let gpc = gs.pieces.byid_mut(piece)?;