Commit 3813c011 authored by Leonardo Schwarz's avatar Leonardo Schwarz

Fix test and fmt.

parent f95a75f3
Pipeline #121448 passed with stage
in 1 minute and 22 seconds
......@@ -166,7 +166,10 @@ impl Client {
return Ok(response_body);
}
}
Err(Error::new("MusicBrainz returned 503 (ServiceUnavailable) too many times.", ErrorKind::Communication))
Err(Error::new(
"MusicBrainz returned 503 (ServiceUnavailable) too many times.",
ErrorKind::Communication,
))
}
/// Returns a search builder to search for an area.
......
......@@ -39,7 +39,7 @@ impl Error {
Error {
message: msg.into(),
kind,
backtrace: Backtrace::new()
backtrace: Backtrace::new(),
}
}
......@@ -52,8 +52,7 @@ impl Error {
}
}
impl std::error::Error for Error {
}
impl std::error::Error for Error {}
impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
......@@ -104,7 +103,7 @@ impl From<reqwest_mock::UrlError> for Error {
Error {
message: format!("reqwest_mock url error: {}", e),
kind: ErrorKind::Internal,
backtrace: Backtrace::new()
backtrace: Backtrace::new(),
}
}
}
......@@ -10,11 +10,11 @@ pub fn musicbrainz_context<'d>() -> Context<'d> {
pub mod test_utils {
use crate::client::{Client, ClientConfig, ClientWaits};
use crate::entities::{Mbid, Resource};
use crate::errors::ClientError;
use crate::errors::Error;
use reqwest_mock::GenericClient as HttpClient;
use xpath_reader::reader::FromXml;
pub fn fetch_entity<E: Resource + FromXml>(mbid: &Mbid) -> Result<E, ClientError> {
pub fn fetch_entity<E: Resource + FromXml>(mbid: &Mbid) -> Result<E, Error> {
let mut client = Client::with_http_client(
ClientConfig {
user_agent: "MusicBrainz-Rust/Testing".to_string(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment