aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPinapelz <yukais@pinapelz.com>2024-08-22 21:25:16 -0700
committerPinapelz <yukais@pinapelz.com>2024-08-22 21:25:16 -0700
commit9dfb99ff7ad044efc79a3ed95bd96949d47538f2 (patch)
tree8d032ef831a7a852f21aedac6cfd89430d28ff23 /src
parent71fa2ccab6417c936884eb0c343853d8c240407f (diff)
shorten duration conversion function name
Diffstat (limited to 'src')
-rw-r--r--src/eorzean_time.rs4
-rw-r--r--src/eorzean_weather.rs6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/eorzean_time.rs b/src/eorzean_time.rs
index 53a728b..02b4cd9 100644
--- a/src/eorzean_time.rs
+++ b/src/eorzean_time.rs
@@ -149,7 +149,7 @@ pub fn convert_to_eorzean_time<T: ToUnixTimestamp>(input_time: T) -> (u8, u8) {
///
/// # Returns
/// - An `EorzeanTime` struct representing the Eorzean time equivalent of the input seconds
-pub fn convert_earth_seconds_to_eorzean_duration(seconds: f64) -> EorzeanTime {
+pub fn earth_sec_to_eorzea_duration(seconds: f64) -> EorzeanTime {
let eorzean_seconds = seconds * 1.0/0.0486;
let years = (eorzean_seconds / EORZEA_SECONDS_PER_YEAR) as u64;
@@ -188,7 +188,7 @@ pub fn convert_earth_seconds_to_eorzean_duration(seconds: f64) -> EorzeanTime {
///
/// # Returns
/// - A `i64` representing the number of Earth seconds corresponding to the Eorzean duration
-pub fn convert_eorzean_duration_to_earth_seconds(eorzean_duration: EorzeanTime) -> f64 {
+pub fn eorzea_duration_to_earth_sec(eorzean_duration: EorzeanTime) -> f64 {
let total_seconds = eorzean_duration.years as f64 * EORZEA_SECONDS_PER_YEAR +
eorzean_duration.moons as f64 * EORZEA_SECONDS_PER_MOON +
eorzean_duration.weeks as f64 * EORZEA_SECONDS_PER_WEEK +
diff --git a/src/eorzean_weather.rs b/src/eorzean_weather.rs
index 512b729..bb94c5d 100644
--- a/src/eorzean_weather.rs
+++ b/src/eorzean_weather.rs
@@ -3,7 +3,7 @@ use serde::{Deserialize, Serialize};
use serde_json::from_str;
use std::fs;
use crate::eorzean_time::convert_to_eorzean_time;
-use crate::eorzean_time::convert_eorzean_duration_to_earth_seconds;
+use crate::eorzean_time::eorzea_duration_to_earth_sec;
use crate::eorzean_time::EorzeanTime;
use crate::eorzean_time::ToUnixTimestamp;
@@ -116,7 +116,7 @@ pub fn calculate_current_weather_interval<T: ToUnixTimestamp>(current_time: T) -
};
- let seconds_since_start_interval = convert_eorzean_duration_to_earth_seconds(
+ let seconds_since_start_interval = eorzea_duration_to_earth_sec(
EorzeanTime {
years: 0,
moons: 0,
@@ -128,7 +128,7 @@ pub fn calculate_current_weather_interval<T: ToUnixTimestamp>(current_time: T) -
}
);
- let seconds_to_end_interval = convert_eorzean_duration_to_earth_seconds(
+ let seconds_to_end_interval = eorzea_duration_to_earth_sec(
EorzeanTime {
years: 0,
moons: 0,
send patches to the email below
yukais@pinapelz.com
include the subject [PATCH repo_name]
pinapelz.com
homepage