Compare commits

...

4 Commits

Author SHA1 Message Date
KD
47f336d04d Merge branch 'warning-fix' into 'dev'
Making some changes to address warnings

See merge request kdeng00/icarus-models!36
2025-03-16 22:25:19 +00:00
e497ce11e0 Making some changes to address warnings
Constants changed
2025-03-16 15:15:31 -04:00
KD
7f5f546f65 Merge branch 'version_bump' into 'dev'
Updated version

See merge request kdeng00/icarus-models!35
2025-03-15 21:30:10 +00:00
a84d59a5f5 Updated version 2025-03-15 17:25:55 -04:00
5 changed files with 24 additions and 19 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "icarus-models"
version = "0.1.7"
version = "0.1.10"
edition = "2024"
description = "models used for the icarus project"
license = "MIT"

View File

@@ -1,5 +1,5 @@
pub const DEFAULT_MUSIC_EXTENSION: &str = FLAC_EXTENSION;
pub const FLAC_EXTENSION: &str = ".flac";
pub const WAV_EXTENSION: &str = ".wav";
pub const MPTHREE_EXTENSION: &str = ".mp3";
pub const JPG_EXTENSION: &str = ".jpg";
pub const DEFAULTMUSICEXTENSION: &str = FLACEXTENSION;
pub const FLACEXTENSION: &str = ".flac";
pub const WAVEXTENSION: &str = ".wav";
pub const MPTHREEEXTENSION: &str = ".mp3";
pub const JPGEXTENSION: &str = ".jpg";

View File

@@ -108,9 +108,9 @@ impl Song {
let directory = &self.directory;
let mut buffer: String = String::from(directory.clone());
let lastIndex = directory.len() - 1;
let last_index = directory.len() - 1;
if let Some(character) = directory.chars().nth(lastIndex) {
if let Some(character) = directory.chars().nth(last_index) {
if character != '/' {
buffer += "/";
}
@@ -127,9 +127,9 @@ impl Song {
}
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> {
let pathResult = self.song_path();
let path_result = self.song_path();
match pathResult {
match path_result {
Ok(path) => {
let mut file = std::fs::File::open(path)?;
let mut buffer: Vec<u8> = Vec::new();
@@ -175,9 +175,9 @@ mod embedded {
let directory = &self.directory;
let mut buffer: String = String::from(directory.clone());
let lastIndex = directory.len() - 1;
let last_index = directory.len() - 1;
if let Some(character) = directory.chars().nth(lastIndex) {
if let Some(character) = directory.chars().nth(last_index) {
if character != '/' {
buffer += "/";
}
@@ -194,9 +194,9 @@ mod embedded {
}
pub fn to_data(&self) -> Result<Vec<u8>, std::io::Error> {
let pathResult = self.song_path();
let path_result = self.song_path();
match pathResult {
match path_result {
Ok(path) => {
let mut file = std::fs::File::open(path)?;
let mut buffer: Vec<u8> = Vec::new();

View File

@@ -58,7 +58,13 @@ impl Token {
}
// TODO: Implement
pub fn contains_scope(&self, des_scope: String) -> bool {
pub fn contains_scope(&self, des_scope: &String) -> bool {
let extracted_token: String = String::from("Token");
if extracted_token == *des_scope {
return true;
}
return false;
}
}

View File

@@ -1,9 +1,8 @@
use std::default::Default;
mod types {
pub enum Types {
WAV_EXTENSION,
FLAC_EXTENSION,
MP_EXTENSION,
WavExtension,
FlacExtension,
MPThreeExtension,
}
}