Skip to content

Commit 837a7ec

Browse files
committed
codegen: macros: remove media_type wrapper
My pull request for `const` constructor has been merged: <picoHz/mediatype#24>
1 parent 37361ab commit 837a7ec

2 files changed

Lines changed: 2 additions & 21 deletions

File tree

codegen/src/generator.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ fn rank_media_type(
330330
index: usize,
331331
preference: &[MediaClass],
332332
) -> impl Ord + use<> {
333-
use crate::macros::media_type as new;
333+
use mediatype::media_type as new;
334334

335335
let media_class = MediaClass::from(media_type);
336336
let essence = media_type.essence();
@@ -412,10 +412,9 @@ pub enum MediaClass {
412412

413413
impl From<&MediaType<'_>> for MediaClass {
414414
fn from(other: &MediaType) -> Self {
415+
use mediatype::media_type as new;
415416
use mediatype::names::*;
416417

417-
use crate::macros::media_type as new;
418-
419418
let essence = other.essence();
420419

421420
if essence == new!(APPLICATION / JSON)

codegen/src/macros.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,3 @@ macro_rules! __static_json {
4545
)*
4646
}
4747
}
48-
49-
/// Construct a constant [`MediaType`][mediatype::MediaType].
50-
///
51-
/// This simply forwards tokens to [`mediatype::media_type`],
52-
/// but wraps the invocation in a `const` block.
53-
///
54-
/// It can be removed when [PR#24] is merged, if ever.
55-
///
56-
/// [PR#24]: https://github.com/picoHz/mediatype/pull/24
57-
#[doc(inline)]
58-
pub use crate::__media_type as media_type;
59-
60-
// <https://github.com/picoHz/mediatype/pull/24>
61-
#[doc(hidden)]
62-
#[macro_export]
63-
macro_rules! __media_type {
64-
($($tt:tt)+) => { const { mediatype::media_type!($($tt)+) } }
65-
}

0 commit comments

Comments
 (0)