Skip to content

Commit

Permalink
Enable building any ServerFnError<T> using ServerFnError::<T>::new
Browse files Browse the repository at this point in the history
Previously it was only possible to build the `NoCustomError` case this
way.
  • Loading branch information
nicolas-guichard committed Nov 17, 2024
1 parent a9ad221 commit a83b0d0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server_fn/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ pub enum ServerFnError<E = NoCustomError> {
MissingArg(String),
}

impl ServerFnError<NoCustomError> {
impl<T> ServerFnError<T> {
/// Constructs a new [`ServerFnError::ServerError`] from some other type.
pub fn new(msg: impl ToString) -> Self {
Self::ServerError(msg.to_string())
Expand Down

0 comments on commit a83b0d0

Please sign in to comment.