Doc strings
This commit is contained in:
parent
f8b5680dc0
commit
0899a45587
@ -28,7 +28,7 @@ pub struct JsonDatabase {
|
||||
}
|
||||
|
||||
impl JsonDatabase {
|
||||
/// Create a new JSON database with the provided backend, e.g. [JsonDatabaseFileBackend].
|
||||
/// Create a new JSON database with the provided backend, e.g. [`JsonDatabaseFileBackend`].
|
||||
pub fn new(backend: Box<dyn JsonDatabaseBackend + Send + Sync>) -> Self {
|
||||
JsonDatabase { backend }
|
||||
}
|
||||
@ -58,7 +58,7 @@ pub struct JsonDatabaseFileBackend {
|
||||
}
|
||||
|
||||
impl JsonDatabaseFileBackend {
|
||||
/// Create a [JsonDatabaseFileBackend] that will read/write to the provided path.
|
||||
/// Create a [`JsonDatabaseFileBackend`] that will read/write to the provided path.
|
||||
pub fn new(path: &Path) -> Self {
|
||||
JsonDatabaseFileBackend {
|
||||
path: path.to_path_buf(),
|
||||
|
@ -106,7 +106,7 @@ trait LibraryPrivate {
|
||||
}
|
||||
|
||||
impl BeetsLibrary {
|
||||
/// Create a new beets library with the provided executor, e.g. [BeetsLibraryCommandExecutor].
|
||||
/// Create a new beets library with the provided executor, e.g. [`BeetsLibraryCommandExecutor`].
|
||||
pub fn new(executor: Box<dyn BeetsLibraryExecutor + Send + Sync>) -> BeetsLibrary {
|
||||
BeetsLibrary { executor }
|
||||
}
|
||||
@ -243,7 +243,7 @@ pub struct BeetsLibraryCommandExecutor {
|
||||
}
|
||||
|
||||
impl BeetsLibraryCommandExecutor {
|
||||
/// Create a new [BeetsLibraryCommandExecutor] that uses the provided beets executable.
|
||||
/// Create a new [`BeetsLibraryCommandExecutor`] that uses the provided beets executable.
|
||||
pub fn new(bin: &str) -> Self {
|
||||
BeetsLibraryCommandExecutor {
|
||||
bin: bin.to_string(),
|
||||
@ -259,7 +259,7 @@ impl BeetsLibraryCommandExecutor {
|
||||
}
|
||||
|
||||
impl Default for BeetsLibraryCommandExecutor {
|
||||
/// Create a new [BeetsLibraryCommandExecutor] that uses the system's default beets executable.
|
||||
/// Create a new [`BeetsLibraryCommandExecutor`] that uses the system's default beets executable.
|
||||
fn default() -> Self {
|
||||
BeetsLibraryCommandExecutor::new("beet")
|
||||
}
|
||||
|
@ -17,19 +17,19 @@ pub enum QueryOption<T> {
|
||||
}
|
||||
|
||||
impl<T> QueryOption<T> {
|
||||
/// Return `true` if [QueryOption] is not [QueryOption::None].
|
||||
/// Return `true` if [`QueryOption`] is not [`QueryOption::None`].
|
||||
pub fn is_some(&self) -> bool {
|
||||
!matches!(self, QueryOption::None)
|
||||
}
|
||||
|
||||
/// Return `true` if [QueryOption] is [QueryOption::None].
|
||||
/// Return `true` if [`QueryOption`] is [`QueryOption::None`].
|
||||
pub fn is_none(&self) -> bool {
|
||||
matches!(self, QueryOption::None)
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Default for QueryOption<T> {
|
||||
/// Create a [QueryOption::None] for type `T`.
|
||||
/// Create a [`QueryOption::None`] for type `T`.
|
||||
fn default() -> Self {
|
||||
Self::None
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user