Skip to content

Commit

Permalink
Merge pull request #22 from szepeviktor/fix-typos
Browse files Browse the repository at this point in the history
Fix typos
  • Loading branch information
dantleech committed Sep 2, 2023
2 parents d1a5ca5 + b039e33 commit 2d9c10d
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/component/polyline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ use tui::{

use crate::{
app::App,
ui::color::{gradiant, Rgb},
ui::color::{gradient, Rgb},
};

pub fn draw<B: Backend>(
Expand Down Expand Up @@ -78,7 +78,7 @@ pub fn draw<B: Backend>(
y1: from.1 + 1.0,
x2: to.0 + 1.0,
y2: to.1 + 1.0,
color: gradiant(
color: gradient(
Rgb {
red: 0,
green: 255,
Expand Down
4 changes: 2 additions & 2 deletions src/component/splits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use tui::{
Frame,
};

use crate::{app::App, ui::color::{gradiant, Rgb}, store::activity::ActivitySplit};
use crate::{app::App, ui::color::{gradient, Rgb}, store::activity::ActivitySplit};

pub fn draw<B: Backend>(
app: &mut App,
Expand Down Expand Up @@ -67,7 +67,7 @@ pub fn draw<B: Backend>(
.use_unicode(true)
.style(Style::default().fg(Color::White))
.gauge_style(Style::default().fg(
gradiant(
gradient(
Rgb { red: 0, green: 255, blue: 0 },
Rgb { red: 255, green: 0, blue: 0 },
split.seconds_per_meter() - min,
Expand Down
8 changes: 4 additions & 4 deletions src/sync/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ use crate::event::logger::Logger;
use crate::store::activity::Activity;


pub struct AcitivityConverter<'a> {
pub struct ActivityConverter<'a> {
pool: &'a SqlitePool,
event_sender: EventSender,
logger: Logger,
}

impl AcitivityConverter<'_> {
impl ActivityConverter<'_> {
pub fn new(
pool: &SqlitePool,
event_sender: EventSender,
logger: Logger,
) -> AcitivityConverter<'_> {
AcitivityConverter {
) -> ActivityConverter<'_> {
ActivityConverter {
pool,
event_sender,
logger,
Expand Down
4 changes: 2 additions & 2 deletions src/sync/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use tokio::{task, sync::mpsc::Receiver};

use crate::{authenticator::Authenticator, event::{input::EventSender, logger::Logger}, client::{StravaConfig, new_strava_client}};

use self::{ingest_activities::IngestActivitiesTask, ingest_activity::IngestActivityTask, convert::AcitivityConverter};
use self::{ingest_activities::IngestActivitiesTask, ingest_activity::IngestActivityTask, convert::ActivityConverter};

pub mod convert;
pub mod ingest_activities;
Expand Down Expand Up @@ -47,7 +47,7 @@ pub async fn spawn_sync<'a>(
.execute()
.await
.unwrap();
AcitivityConverter::new(&pool, event_sender.clone(), logger.clone())
ActivityConverter::new(&pool, event_sender.clone(), logger.clone())
.convert()
.await
.unwrap();
Expand Down
8 changes: 4 additions & 4 deletions src/ui/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ impl Rgb {
}
}

pub fn gradiant(start: Rgb, end: Rgb, offset: f64, size: f64) -> Rgb {
pub fn gradient(start: Rgb, end: Rgb, offset: f64, size: f64) -> Rgb {
let rdiff = (end.red as f64 - start.red as f64) / size;
let gdiff = (end.green as f64 - start.green as f64) / size;
let bdiff = (end.blue as f64 - start.blue as f64) / size;
Expand All @@ -41,11 +41,11 @@ pub fn gradiant(start: Rgb, end: Rgb, offset: f64, size: f64) -> Rgb {

#[cfg(test)]
mod tests {
use super::{gradiant, Rgb};
use super::{gradient, Rgb};

#[test]
fn test_gradiant() {
let rgb = gradiant(
fn test_gradient() {
let rgb = gradient(
Rgb {
red: 0,
green: 255,
Expand Down

0 comments on commit 2d9c10d

Please sign in to comment.