Skip to content

Commit

Permalink
Avoid duplication for Series (#1138)
Browse files Browse the repository at this point in the history
* avoid duplication for series

* revised series
  • Loading branch information
AnonimAnonim2245 committed Jan 19, 2024
1 parent 4c6aa8d commit e149fda
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions widgetry_demo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub fn main() {
run(settings);
}


fn run(mut settings: Settings) {
abstutil::logger::setup();
settings = settings.read_svg(Box::new(abstio::slurp_bytes));
Expand Down Expand Up @@ -55,11 +56,11 @@ impl Demo {
tabs,
}
}
fn create_series<F>(&self, label: &str, color: Color, func: F) -> Series
fn create_series<F>(&self, label: &str, color: Color, func: F) -> Series<Time, usize>
where
F: Fn(usize) -> usize,
{
Series {
Series{
label: label.to_string(),
color,
pts: (0..(self.elapsed.inner_seconds() as usize))
Expand Down

0 comments on commit e149fda

Please sign in to comment.