Skip to content

Commit

Permalink
refactor: mark RenderError::new as deprecated
Browse files Browse the repository at this point in the history
  • Loading branch information
sunng87 committed May 15, 2023
1 parent 743acbe commit 275629e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ impl From<ScriptError> for RenderError {
}

impl RenderError {
#[deprecated(since = "5.0.0", note = "Use RenderErrorReason instead")]
pub fn new<T: AsRef<str>>(desc: T) -> RenderError {
RenderError {
desc: desc.as_ref().to_owned(),
Expand All @@ -150,10 +151,11 @@ impl RenderError {
where
E: StdError + Send + Sync + 'static,
{
let mut e = RenderError::new(error_info);
e.cause = Some(Box::new(cause));

e
RenderError {
desc: error_info.to_owned(),
cause: Some(Box::new(cause)),
..Default::default()
}
}

#[inline]
Expand Down

0 comments on commit 275629e

Please sign in to comment.