Skip to content

Instantly share code, notes, and snippets.

View jupart's full-sized avatar

Justin Partain jupart

View GitHub Profile
let mut text = Vec::new();
let lines = lines_from_file("../text");
for line in lines {
text.push(Asset::new(Font::load("../FiraSans-Regular.ttf")
.and_then(|font| {
let style = FontStyle::new(32.0, Color::BLACK);
result(font.render(line.as_str(), &style))
}))
);
}
pub fn dijkstra<N, C, FN, IN, FS>(
start: &N,
neighbours: FN,
success: FS
) -> Option<(Vec<N>, C)>
where
N: Eq + Hash + Clone,
C: Zero + Ord + Copy,
FN: FnMut(&N) -> IN,
IN: IntoIterator<Item = (N, C)>,
error[E0271]: type mismatch resolving `<std::vec::Vec<skirmmap::MapPoint> as std::iter::IntoIterator>::Item == (skirmmap::MapPoint, _)`
--> src/components.rs:56:15
|
56 | match dijkstra(&current_pos, |p| p.neighbors(map), |p| *p == move_to) {
| ^^^^^^^^ expected struct `skirmmap::MapPoint`, found tuple
|
= note: expected type `skirmmap::MapPoint`
found type `(skirmmap::MapPoint, _)`
= note: required by `pathfinding::dijkstra`
error[E0277]: the trait bound `serde::export::Result<std::fs::DirEntry, std::io::Error>: std::convert::AsRef<std::path::Path>` is not satisfied
--> src/asset_storage.rs:29:25
|
29 | let sound = audio::Source::new(ctx, path)?;
| ^^^^^^^^^^^^^^^^^^ the trait `std::convert::AsRef<std::path::Path>` is not implemented for `serde::export::Result<std::fs::DirEntry, std::io::Error>`
|
= note: required by `ggez::audio::Source::new`
error: aborting due to previous error
[INFO ] Logger: Record log in /home/jpartain/.kivy/logs/kivy_17-01-06_3.txt
[INFO ] Kivy: v1.9.2-dev0
[INFO ] Python: v3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609]
[INFO ] Factory: 193 symbols loaded
[DEBUG ] Cache: register <kv.lang> with limit=None, timeout=None
[DEBUG ] Cache: register <kv.image> with limit=None, timeout=60
[DEBUG ] Cache: register <kv.atlas> with limit=None, timeout=None
[INFO ] Image: Providers: img_tex, img_dds, img_gif, img_pygame, img_pil (img_ffpyplayer ignored)
[DEBUG ] Cache: register <kv.texture> with limit=1000, timeout=60