Merge branch 'warning-fix' into 'dev'
Making some changes to address warnings See merge request kdeng00/icarus-models!36
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
pub const DEFAULT_MUSIC_EXTENSION: &str = FLAC_EXTENSION;
|
pub const DEFAULTMUSICEXTENSION: &str = FLACEXTENSION;
|
||||||
pub const FLAC_EXTENSION: &str = ".flac";
|
pub const FLACEXTENSION: &str = ".flac";
|
||||||
pub const WAV_EXTENSION: &str = ".wav";
|
pub const WAVEXTENSION: &str = ".wav";
|
||||||
pub const MPTHREE_EXTENSION: &str = ".mp3";
|
pub const MPTHREEEXTENSION: &str = ".mp3";
|
||||||
pub const JPG_EXTENSION: &str = ".jpg";
|
pub const JPGEXTENSION: &str = ".jpg";
|
||||||
|
16
src/song.rs
16
src/song.rs
@@ -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 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 != '/' {
|
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 pathResult = self.song_path();
|
let path_result = self.song_path();
|
||||||
|
|
||||||
match pathResult {
|
match path_result {
|
||||||
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 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 != '/' {
|
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 pathResult = self.song_path();
|
let path_result = self.song_path();
|
||||||
|
|
||||||
match pathResult {
|
match path_result {
|
||||||
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();
|
||||||
|
@@ -58,7 +58,13 @@ 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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
use std::default::Default;
|
|
||||||
|
|
||||||
mod types {
|
mod types {
|
||||||
pub enum Types {
|
pub enum Types {
|
||||||
WAV_EXTENSION,
|
WavExtension,
|
||||||
FLAC_EXTENSION,
|
FlacExtension,
|
||||||
MP_EXTENSION,
|
MPThreeExtension,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user