首页 > 解决方案 > 模式 `&Unspecified` 和 `&__Nonexhaustive` 未涵盖

问题描述

我在一个match街区得到这个:

patterns `&Unspecified` and `&__Nonexhaustive` not covered

编码:

fn vipaddress_from_ipddress(address: &IpAddress) -> VIpAddress {
    match address {

我认为&Unspecified与不考虑 null 情况有关,但 Rust 中的引用不能为 null。是什么 &__Nonexhaustive

标签: rust

解决方案


似乎是一个未记录的枚举变体:https ://docs.rs/ethox/0.0.1-wip/src/ethox/wire/ip.rs.html#15

这可能表明开发者不期望IpAddress用户match; 也许已经有一个功能在做你想做的事?


推荐阅读