Saving changes
All checks were successful
Rust Build / Check (pull_request) Successful in 24s
Rust Build / Test Suite (pull_request) Successful in 25s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 26s
All checks were successful
Rust Build / Check (pull_request) Successful in 24s
Rust Build / Test Suite (pull_request) Successful in 25s
Rust Build / Rustfmt (pull_request) Successful in 26s
Rust Build / Clippy (pull_request) Successful in 26s
Rust Build / build (pull_request) Successful in 26s
This commit is contained in:
@@ -1,11 +1,12 @@
|
|||||||
pub mod collection {
|
pub mod collection {
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
use std::default::Default;
|
||||||
|
|
||||||
fn is_set(num: &i32) -> bool {
|
fn is_set(num: &i32) -> bool {
|
||||||
*num >= 0
|
*num >= 0
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
pub struct Album {
|
pub struct Album {
|
||||||
#[serde(skip_serializing_if = "String::is_empty")]
|
#[serde(skip_serializing_if = "String::is_empty")]
|
||||||
#[serde(alias = "album")]
|
#[serde(alias = "album")]
|
||||||
@@ -19,7 +20,7 @@ pub mod collection {
|
|||||||
pub tracks: Vec<Track>,
|
pub tracks: Vec<Track>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, Deserialize, Serialize)]
|
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
|
||||||
pub struct Track {
|
pub struct Track {
|
||||||
pub title: String,
|
pub title: String,
|
||||||
pub artist: String,
|
pub artist: String,
|
||||||
|
@@ -155,11 +155,14 @@ mod song_tests {
|
|||||||
mod album_tests {
|
mod album_tests {
|
||||||
|
|
||||||
use crate::utils;
|
use crate::utils;
|
||||||
use icarus_models::album;
|
use icarus_models::album::collection::Album;
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn parse_album() {
|
fn parse_album() {
|
||||||
let test_dir = utils::get_tests_directory();
|
let test_dir = utils::get_tests_directory();
|
||||||
if utils::does_directory_exists(&test_dir) {}
|
if utils::does_directory_exists(&test_dir) {
|
||||||
|
let album = Album::default();
|
||||||
|
println!("Album title: {}", album.title);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user