Skip to content

Commit 042d8fd

Browse files
authored
feat: impl Into<ErrorObject> for Infallible (#1542)
1 parent 78ca757 commit 042d8fd

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

types/src/error.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
// IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2525
// DEALINGS IN THE SOFTWARE.
2626

27+
use std::convert::Infallible;
2728
use std::fmt;
2829

2930
use serde::de::Deserializer;
@@ -110,6 +111,12 @@ impl From<ErrorCode> for ErrorObject<'_> {
110111
}
111112
}
112113

114+
impl From<Infallible> for ErrorObject<'_> {
115+
fn from(e: Infallible) -> Self {
116+
match e {}
117+
}
118+
}
119+
113120
/// Parse error code.
114121
pub const PARSE_ERROR_CODE: i32 = -32700;
115122
/// Invalid request error code.

0 commit comments

Comments
 (0)