Skip to content

Commit

Permalink
Some changes
Browse files Browse the repository at this point in the history
  • Loading branch information
d-e-s-o committed Jul 17, 2023
1 parent ce340cd commit b5f1d03
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions src/api_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ impl ApiInfo {
key_id: impl ToString,
secret: impl ToString,
) -> Result<Self, Error> {
let api_base_url = Url::parse(api_base_url.as_ref())?;
let api_base_url = Url::parse(api_base_url.as_ref()).unwrap();
let api_stream_url = make_api_stream_url(api_base_url.clone())?;

Ok(Self {
Expand Down Expand Up @@ -106,7 +106,7 @@ impl ApiInfo {
.map_err(|_| {
Error::Str(format!("{ENV_API_BASE_URL} environment variable is not a valid string").into())
})?;
let api_base_url = Url::parse(&api_base_url)?;
let api_base_url = Url::parse(&api_base_url).unwrap();

let api_stream_url = var_os(ENV_API_STREAM_URL)
.map(Result::<_, Error>::Ok)
Expand All @@ -122,7 +122,7 @@ impl ApiInfo {
format!("{ENV_API_STREAM_URL} environment variable is not a valid string").into(),
)
})?;
let api_stream_url = Url::parse(&api_stream_url)?;
let api_stream_url = Url::parse(&api_stream_url).unwrap();

let key_id = var_os(ENV_KEY_ID)
.ok_or_else(|| Error::Str(format!("{ENV_KEY_ID} environment variable not found").into()))?
Expand Down
4 changes: 2 additions & 2 deletions src/data/v2/stream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ where
url.set_path(&format!("v2/{}", component));
url
},
SourceVariant::Url(url) => Url::parse(&url)?,
SourceVariant::Url(url) => Url::parse(&url).unwrap(),
};

let stream = Unfold::new(
Expand Down Expand Up @@ -1659,7 +1659,7 @@ mod tests {
.unwrap_err();

match err {
Error::Url(..) => (),
//Error::Url(..) => (),
_ => panic!("Received unexpected error: {err:?}"),
};
}
Expand Down
14 changes: 7 additions & 7 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ pub enum Error {
/// An error directly originating in this crate.
#[error("{0}")]
Str(Str),
/// An URL parsing error.
#[error("failed to parse the URL")]
Url(
#[from]
#[source]
ParseError,
),
///// An URL parsing error.
//#[error("failed to parse the URL")]
//Url(
// #[from]
// #[source]
// ParseError,
//),
/// A websocket error.
#[error("encountered a websocket related error")]
WebSocket(
Expand Down

0 comments on commit b5f1d03

Please sign in to comment.