clippy
This commit is contained in:
@@ -583,9 +583,9 @@ impl From<&Board> for MapFile {
|
|||||||
for x in 0..board.width {
|
for x in 0..board.width {
|
||||||
let (glyph, arch) = board.get(x, y);
|
let (glyph, arch) = board.get(x, y);
|
||||||
let key = (*glyph, *arch);
|
let key = (*glyph, *arch);
|
||||||
if !cell_to_key.contains_key(&key) {
|
if let std::collections::hash_map::Entry::Vacant(e) = cell_to_key.entry(key) {
|
||||||
if key == canonical_empty {
|
if key == canonical_empty {
|
||||||
cell_to_key.insert(key, ' ');
|
e.insert(' ');
|
||||||
palette.insert(
|
palette.insert(
|
||||||
" ".to_string(),
|
" ".to_string(),
|
||||||
PaletteEntry {
|
PaletteEntry {
|
||||||
@@ -599,7 +599,7 @@ impl From<&Board> for MapFile {
|
|||||||
let ch = *pool_iter
|
let ch = *pool_iter
|
||||||
.next()
|
.next()
|
||||||
.expect("board has more than 92 unique non-canonical cell types");
|
.expect("board has more than 92 unique non-canonical cell types");
|
||||||
cell_to_key.insert(key, ch);
|
e.insert(ch);
|
||||||
palette.insert(
|
palette.insert(
|
||||||
ch.to_string(),
|
ch.to_string(),
|
||||||
PaletteEntry {
|
PaletteEntry {
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ fn register_read_api(engine: &mut Engine, board: &BoardRef, board_queue: &BoardQ
|
|||||||
let b = board.clone();
|
let b = board.clone();
|
||||||
engine.register_fn("has_tag", move |ctx: NativeCallContext, tag: ImmutableString| {
|
engine.register_fn("has_tag", move |ctx: NativeCallContext, tag: ImmutableString| {
|
||||||
let src = source_of(&ctx);
|
let src = source_of(&ctx);
|
||||||
b.borrow().objects.get(&src).map_or(false, |o| o.tags.contains(tag.as_str()))
|
b.borrow().objects.get(&src).is_some_and(|o| o.tags.contains(tag.as_str()))
|
||||||
});
|
});
|
||||||
|
|
||||||
// get_tags() -> Array of strings: the calling object's current tag set.
|
// get_tags() -> Array of strings: the calling object's current tag set.
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ use std::time::Duration;
|
|||||||
use crate::archetype::Archetype;
|
use crate::archetype::Archetype;
|
||||||
use crate::board::tests::{crate_at, open_board, wall_at};
|
use crate::board::tests::{crate_at, open_board, wall_at};
|
||||||
use crate::game::GameState;
|
use crate::game::GameState;
|
||||||
use crate::script::Direction;
|
|
||||||
use super::{scripted_object, log_texts};
|
use super::{scripted_object, log_texts};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
Reference in New Issue
Block a user