From 057808c1cc7aa07aeb3c2d512991ad620f23b026 Mon Sep 17 00:00:00 2001 From: Wojciech Kozlowski Date: Wed, 29 Mar 2023 09:44:59 +0900 Subject: [PATCH] Clean up documentation --- src/lib.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index d7c1a7d..2fa4bc8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,35 +1,37 @@ +//! MusicHoard - a music collection manager. + use serde::{Deserialize, Serialize}; use uuid; -/// The [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier). -type Mbid = uuid::Uuid; +/// [MusicBrainz Identifier](https://musicbrainz.org/doc/MusicBrainz_Identifier) (MBID). +pub type Mbid = uuid::Uuid; -/// An artist. May be linked to MusicBrainz. +/// [Artist](https://musicbrainz.org/doc/Artist). #[derive(Deserialize, Serialize)] pub struct Artist { pub name: String, pub mbid: Option, } -/// A single track on a release. +/// [Track](https://musicbrainz.org/doc/Track). #[derive(Deserialize, Serialize)] pub struct Track { pub number: u32, pub title: String, pub artist: Artist, + pub mbid: Option, } -/// MusicHoard release corresponds to MusicBrainz' concept of a release. However, it does not link -/// to MusicBrainz as the intention of MusicHoard is to manage releases locally. +/// [Release](https://musicbrainz.org/doc/Release). #[derive(Deserialize, Serialize)] pub struct Release { pub title: String, pub artist: String, pub tracks: Vec, + pub mbid: Option, } -/// MusicHoard uses MusicBrainz [primary release group -/// type](https://musicbrainz.org/doc/Release_Group/Type) +/// [Release group primary type](https://musicbrainz.org/doc/Release_Group/Type). #[derive(Deserialize, Serialize)] pub enum ReleaseGroupType { Album, @@ -38,7 +40,7 @@ pub enum ReleaseGroupType { Other, } -/// MusicHoard uses MusicBrainz' [Release Group concept](https://musicbrainz.org/doc/Release_Group). +/// [Release group](https://musicbrainz.org/doc/Release_Group). #[derive(Deserialize, Serialize)] pub struct ReleaseGroup { pub r#type: ReleaseGroupType,