Skip to content

Commit e36d7a3

Browse files
committed
fix: resolve lifetime annotation warnings
- Add explicit lifetime annotations to function return types - Fix ascii_digits.rs: Vec<Line> to Vec<Line<'_>> - Fix mario_animation.rs: Canvas<impl Fn> to Canvas<'_, impl Fn> Resolves mismatched_lifetime_syntaxes warnings for cleaner compilation
1 parent fccff1a commit e36d7a3

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src/ascii_digits.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ pub fn get_digit_lines(digit: char) -> Vec<&'static str> {
9090
}
9191
}
9292

93-
pub fn create_time_display_lines(time_str: &str, color: Color) -> Vec<Line> {
93+
pub fn create_time_display_lines(time_str: &str, color: Color) -> Vec<Line<'_>> {
9494
let chars: Vec<char> = time_str.chars().collect();
9595
let mut lines = vec![String::new(); 5]; // 5 lines for each digit
9696

src/mario_animation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl MarioAnimation {
273273
self.mushroom_particles.retain(|p| p.life > 0.0);
274274
}
275275

276-
pub fn render(&self, _area: Rect) -> Canvas<impl Fn(&mut Context)> {
276+
pub fn render(&self, _area: Rect) -> Canvas<'_, impl Fn(&mut Context)> {
277277
Canvas::default()
278278
.marker(Marker::Braille)
279279
.x_bounds([0.0, 240.0])

0 commit comments

Comments
 (0)