pass str ref as parameter
This commit is contained in:
parent
b7d7b27566
commit
412072abda
|
@ -163,7 +163,7 @@ impl Level {
|
||||||
Ok(Self { size, player, map })
|
Ok(Self { size, player, map })
|
||||||
}
|
}
|
||||||
|
|
||||||
fn read_rle(map: String) -> std::result::Result<Self, ReadError> {
|
fn read_rle(map: &str) -> std::result::Result<Self, ReadError> {
|
||||||
let mut n: usize = 1;
|
let mut n: usize = 1;
|
||||||
|
|
||||||
Self::read(
|
Self::read(
|
||||||
|
@ -534,7 +534,7 @@ pub fn run(config: Config, rle: Option<String>) -> Result<()> {
|
||||||
}
|
}
|
||||||
|
|
||||||
let map = if let Some(rle) = rle {
|
let map = if let Some(rle) = rle {
|
||||||
Level::read_rle(rle)
|
Level::read_rle(&rle)
|
||||||
} else {
|
} else {
|
||||||
Level::read(std::io::stdin().lock())
|
Level::read(std::io::stdin().lock())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue