Compare commits

..

1 Commits

Author SHA1 Message Date
KD
fac33c7987 Merge branch 'dev' into 'main'
Dev

See merge request kdeng00/icarus-models!30
2025-03-15 21:38:00 +00:00
4 changed files with 18 additions and 23 deletions

View File

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

View File

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

View File

@@ -58,13 +58,7 @@ impl Token {
} }
// TODO: Implement // 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; return false;
} }
} }

View File

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