diff options
Diffstat (limited to 'src/utils.rs')
-rw-r--r-- | src/utils.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/utils.rs b/src/utils.rs index ab446f4..8c3b144 100644 --- a/src/utils.rs +++ b/src/utils.rs | |||
@@ -46,7 +46,7 @@ pub fn draw_text<S: AsRef<str>>( | |||
46 | font.set_style(sdl2::ttf::FontStyle::NORMAL); | 46 | font.set_style(sdl2::ttf::FontStyle::NORMAL); |
47 | font.set_hinting(sdl2::ttf::Hinting::Mono); | 47 | font.set_hinting(sdl2::ttf::Hinting::Mono); |
48 | let surface = font | 48 | let surface = font |
49 | .render(if text.is_empty() { " " } else { text.as_ref() }) | 49 | .render(if text.is_empty() { " " } else { text }) |
50 | .blended(color) | 50 | .blended(color) |
51 | .unwrap(); | 51 | .unwrap(); |
52 | let texture = texture_creator | 52 | let texture = texture_creator |
@@ -84,7 +84,7 @@ pub fn load_script<P: AsRef<Path>>(path: P, app: &mut AppState) -> Result<(), Li | |||
84 | .read_to_string(&mut buf) | 84 | .read_to_string(&mut buf) |
85 | .map_err(EvalError::ScriptLoadError)?; | 85 | .map_err(EvalError::ScriptLoadError)?; |
86 | 86 | ||
87 | let mut parser = Parser::new(Lexer::new(&buf, 0)); | 87 | let mut parser = Parser::new(Lexer::new(&buf)); |
88 | let mut evaluator = Evaluator { | 88 | let mut evaluator = Evaluator { |
89 | app, | 89 | app, |
90 | context: Vec::new(), | 90 | context: Vec::new(), |
@@ -94,7 +94,7 @@ pub fn load_script<P: AsRef<Path>>(path: P, app: &mut AppState) -> Result<(), Li | |||
94 | })? { | 94 | })? { |
95 | evaluator.eval(&expr)?; | 95 | evaluator.eval(&expr)?; |
96 | } | 96 | } |
97 | return Ok(()); | 97 | Ok(()) |
98 | } | 98 | } |
99 | 99 | ||
100 | pub fn load_file<P: AsRef<Path>>(path: P) -> Result<Image, io::Error> { | 100 | pub fn load_file<P: AsRef<Path>>(path: P) -> Result<Image, io::Error> { |