Skip to content

Commit 3a655a4

Browse files
committed
refactor: Rename features of optional functionality to match crates
BREAKING CHANGE: This is breaking since features are being renamed
1 parent f8522e7 commit 3a655a4

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1515

1616

1717
## [Unreleased]
18+
### Changed
19+
- Rename the "ipnet" feature to "ipnetwork" to match the dependency.
20+
- Rename the "mac" feature to "macaddr" to match the dependency.
1821

1922

2023
## [0.2.0] - 2025-05-11

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ proc-macro = true
1818
## By default, only generate stdlib types
1919
default = []
2020
## enables generation of [`ipnetwork`] types
21-
ipnet = ["dep:ipnetwork"]
21+
ipnetwork = ["dep:ipnetwork"]
2222
## enables generation of [`macaddr`] types
23-
mac = ["dep:macaddr"]
23+
macaddr = ["dep:macaddr"]
2424

2525
[dependencies]
2626
cfg-if = "1"

src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ make_macro! {
183183
// IpNetwork types
184184

185185
cfg_if::cfg_if! {
186-
if #[cfg(feature = "ipnet")] {
186+
if #[cfg(feature = "ipnetwork")] {
187187
use ipnetwork::{IpNetwork, Ipv4Network, Ipv6Network};
188188

189189
make_macro!{
@@ -198,7 +198,7 @@ cfg_if::cfg_if! {
198198
quote! { ipnetwork::IpNetwork::V6(#inner) }
199199
}
200200
};
201-
"ipnet"
201+
"ipnetwork"
202202
}
203203

204204
make_macro!{
@@ -208,7 +208,7 @@ cfg_if::cfg_if! {
208208
let prefix = net.prefix();
209209
quote! { ipnetwork::Ipv4Network::new_checked(#ip, #prefix).unwrap() }
210210
};
211-
"ipnet"
211+
"ipnetwork"
212212
}
213213

214214

@@ -219,15 +219,15 @@ cfg_if::cfg_if! {
219219
let prefix = net.prefix();
220220
quote! { ipnetwork::Ipv6Network::new_checked(#ip, #prefix).unwrap() }
221221
};
222-
"ipnet"
222+
"ipnetwork"
223223
}
224224
}
225225
}
226226

227227
// MacAddr types
228228

229229
cfg_if::cfg_if! {
230-
if #[cfg(feature = "mac")] {
230+
if #[cfg(feature = "macaddr")] {
231231
use macaddr::{MacAddr, MacAddr6, MacAddr8};
232232

233233
make_macro!{
@@ -242,7 +242,7 @@ cfg_if::cfg_if! {
242242
quote! { macaddr::MacAddr::V8(#inner) }
243243
}
244244
};
245-
"mac"
245+
"macaddr"
246246
}
247247

248248
make_macro! {
@@ -251,7 +251,7 @@ cfg_if::cfg_if! {
251251
let bytes = addr.into_array();
252252
quote! { macaddr::MacAddr6::new(#(#bytes),*) }
253253
};
254-
"mac"
254+
"macaddr"
255255
}
256256

257257
make_macro!{
@@ -260,7 +260,7 @@ cfg_if::cfg_if! {
260260
let bytes = addr.into_array();
261261
quote! { macaddr::MacAddr8::new(#(#bytes),*) }
262262
};
263-
"mac"
263+
"macaddr"
264264
}
265265
}
266266
}

0 commit comments

Comments
 (0)