Skip to content

Commit 9155425

Browse files
committed
A few minor tweaks
1 parent c0450b5 commit 9155425

File tree

6 files changed

+26
-30
lines changed

6 files changed

+26
-30
lines changed

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#![no_std]
1212
//Uncomment as needed or once minimum Rust version is bumped to 1.18
1313
//#![cfg_attr(feature = "cargo-clippy", warn(clippy::pedantic))]
14-
//#![cfg_attr(feature = "cargo-clippy", allow(clippy::absurd_extreme_comparisons, clippy::cast_lossless, clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_precision_loss, clippy::cast_ptr_alignment, clippy::cast_sign_loss, clippy::const_static_lifetime, clippy::doc_markdown, clippy::empty_enum, clippy::erasing_op, clippy::excessive_precision, clippy::expl_impl_clone_on_copy, clippy::identity_op, clippy::if_not_else, clippy::many_single_char_names, clippy::module_inception, clippy::cast_possible_truncation, clippy::too_many_arguments, clippy::transmute_int_to_float, clippy::trivially_copy_pass_by_ref, clippy::unreadable_literal, clippy::unseparated_literal_suffix, clippy::used_underscore_binding))]
14+
//#![cfg_attr(feature = "cargo-clippy", allow(clippy::absurd_extreme_comparisons, clippy::cast_lossless, clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_precision_loss, clippy::cast_ptr_alignment, clippy::cast_sign_loss, clippy::doc_markdown, clippy::empty_enum, clippy::erasing_op, clippy::excessive_precision, clippy::expl_impl_clone_on_copy, clippy::identity_op, clippy::if_not_else, clippy::many_single_char_names, clippy::module_inception, clippy::cast_possible_truncation, clippy::too_many_arguments, clippy::transmute_int_to_float, clippy::trivially_copy_pass_by_ref, clippy::unreadable_literal, clippy::unseparated_literal_suffix, clippy::used_underscore_binding, clippy::redundant_static_lifetimes, clippy::missing_safety_doc))]
1515

1616
#[cfg(feature = "std")]
1717
extern crate std;

src/shared/ifdef.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,16 @@ ENUM!{enum NET_IF_ACCESS_TYPE {
105105
}}
106106
pub type PNET_IF_ACCESS_TYPE = *mut NET_IF_ACCESS_TYPE;
107107
ENUM!{enum NET_IF_DIRECTION_TYPE {
108-
NET_IF_DIRECTION_SENDRECEIVE = 0,
109-
NET_IF_DIRECTION_SENDONLY = 1,
110-
NET_IF_DIRECTION_RECEIVEONLY = 2,
111-
NET_IF_DIRECTION_MAXIMUM = 3,
108+
NET_IF_DIRECTION_SENDRECEIVE,
109+
NET_IF_DIRECTION_SENDONLY,
110+
NET_IF_DIRECTION_RECEIVEONLY,
111+
NET_IF_DIRECTION_MAXIMUM,
112112
}}
113113
pub type PNET_IF_DIRECTION_TYPE = *mut NET_IF_DIRECTION_TYPE;
114114
ENUM!{enum NET_IF_MEDIA_CONNECT_STATE {
115-
MediaConnectStateUnknown = 0,
116-
MediaConnectStateConnected = 1,
117-
MediaConnectStateDisconnected = 2,
115+
MediaConnectStateUnknown,
116+
MediaConnectStateConnected,
117+
MediaConnectStateDisconnected,
118118
}}
119119
pub type PNET_IF_MEDIA_CONNECT_STATE = *mut NET_IF_MEDIA_CONNECT_STATE;
120120
ENUM!{enum NET_IF_MEDIA_DUPLEX_STATE {

src/shared/netioapi.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ const ANY_SIZE: usize = 1;
2929
pub type NETIO_STATUS = DWORD;
3030
pub type NETIOAPI_API = NETIO_STATUS;
3131
ENUM!{enum MIB_NOTIFICATION_TYPE {
32-
MibParameterNotification = 0,
33-
MibAddInstance = 1,
34-
MibDeleteInstance = 2,
35-
MibInitialNotification = 3,
32+
MibParameterNotification,
33+
MibAddInstance,
34+
MibDeleteInstance,
35+
MibInitialNotification,
3636
}}
3737
pub type PMIB_NOTIFICATION_TYPE = *mut MIB_NOTIFICATION_TYPE;
3838
STRUCT!{struct MIB_IF_ROW2_InterfaceAndOperStatusFlags {

src/shared/nldef.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ use shared::minwindef::ULONG;
88
use shared::ntdef::BOOLEAN;
99
ENUM!{enum NL_PREFIX_ORIGIN {
1010
IpPrefixOriginOther = 0,
11-
IpPrefixOriginManual = 1,
12-
IpPrefixOriginWellKnown = 2,
13-
IpPrefixOriginDhcp = 3,
14-
IpPrefixOriginRouterAdvertisement = 4,
11+
IpPrefixOriginManual,
12+
IpPrefixOriginWellKnown,
13+
IpPrefixOriginDhcp,
14+
IpPrefixOriginRouterAdvertisement,
1515
IpPrefixOriginUnchanged = 1 << 4,
1616
}}
1717
pub const NlpoOther: NL_PREFIX_ORIGIN = IpPrefixOriginOther;
@@ -35,17 +35,17 @@ ENUM!{enum NL_SUFFIX_ORIGIN {
3535
IpSuffixOriginUnchanged = 1 << 4,
3636
}}
3737
ENUM!{enum NL_DAD_STATE {
38+
NldsInvalid,
39+
NldsTentative,
40+
NldsDuplicate,
41+
NldsDeprecated,
42+
NldsPreferred,
3843
IpDadStateInvalid = 0,
39-
IpDadStateTentative = 1,
40-
IpDadStateDuplicate = 2,
41-
IpDadStateDeprecated = 3,
42-
IpDadStatePreferred = 4,
44+
IpDadStateTentative,
45+
IpDadStateDuplicate,
46+
IpDadStateDeprecated,
47+
IpDadStatePreferred,
4348
}}
44-
pub const NldsInvalid: NL_DAD_STATE = IpDadStateInvalid;
45-
pub const NldsTentative: NL_DAD_STATE = IpDadStateTentative;
46-
pub const NldsDuplicate: NL_DAD_STATE = IpDadStateDuplicate;
47-
pub const NldsDeprecated: NL_DAD_STATE = IpDadStateDeprecated;
48-
pub const NldsPreferred: NL_DAD_STATE = IpDadStatePreferred;
4949
pub const NL_MAX_METRIC_COMPONENT: ULONG = (1u32 << 31) - 1;
5050
ENUM!{enum NL_ROUTE_PROTOCOL {
5151
RouteProtocolOther = 1,

src/shared/ntddndis.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ ENUM!{enum NDIS_PHYSICAL_MEDIUM {
5959
NdisPhysicalMediumWiredWAN = 17,
6060
NdisPhysicalMediumWiredCoWan = 18,
6161
NdisPhysicalMediumOther = 19,
62-
NdisPhysicalMediumMax = 20, // Not a real physical type, defined as an upper-bound
62+
NdisPhysicalMediumMax = 20,
6363
}}
6464
pub type PNDIS_PHYSICAL_MEDIUM = *mut NDIS_PHYSICAL_MEDIUM;
6565
//2691

src/um/iptypes.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your option.
44
// All files in the project carrying such notice may not be copied, modified, or distributed
55
// except according to those terms.
6-
// #include <winapifamily.h>
7-
// #include <ifdef.h>
8-
// #include <nldef.h>
96
use shared::basetsd::{UINT8, ULONG64};
107
use shared::guiddef::GUID;
118
use shared::ifdef::{
@@ -292,7 +289,6 @@ BITFIELD!{IP_ADAPTER_ADDRESSES_LH Flags: ULONG [
292289
Ipv4Enabled set_Ipv4Enabled[7..8],
293290
Ipv6Enabled set_Ipv6Enabled[8..9],
294291
Ipv6ManagedAddressConfigurationSupported set_Ipv6ManagedAddressConfigurationSupported[9..10],
295-
Reserved set_Reserved[10..32],
296292
]}
297293
pub type PIP_ADAPTER_ADDRESSES_LH = *mut IP_ADAPTER_ADDRESSES_LH;
298294
STRUCT!{struct IP_ADAPTER_ADDRESSES_XP_u_s {

0 commit comments

Comments
 (0)