Skip to content

Commit

Permalink
MakeHeader::HEADER can be a constant
Browse files Browse the repository at this point in the history
  • Loading branch information
glowcoil committed Jun 10, 2023
1 parent 560ff01 commit 0124041
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions com-scrape-types/src/class.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ where
C: Class,
W: Wrapper<C>,
{
fn header() -> Self::Header;
const HEADER: Self::Header;
}

pub trait Class {
Expand Down Expand Up @@ -74,9 +74,7 @@ macro_rules! interface_list {
W: Wrapper<C>,
$($interface: Construct<C, W, { $index * std::mem::size_of::<*mut ()>() as isize }>,)*
{
fn header() -> Self::Header {
$header($($interface::OBJ),*)
}
const HEADER: Self::Header = $header($($interface::OBJ),*);
}
}
}
Expand Down Expand Up @@ -180,7 +178,7 @@ impl<C: Class> ComWrapper<C> {
{
ComWrapper {
inner: Arc::new(ComWrapperInner {
header: C::Interfaces::header(),
header: C::Interfaces::HEADER,
data,
}),
}
Expand Down

0 comments on commit 0124041

Please sign in to comment.