Skip to content

Inline trivial implementations #728

@nazar-pc

Description

@nazar-pc

There are many trivial methods in the code that should be inlined (which will help compiler to generate better code).

Especially in cases like this:

fn encoded_fixed_size() -> Option<usize> {
Some(mem::size_of::<$t>())
}

This is essentially a const method, #[inline(force)] it will reduce the call and corresponding .unwrap() to a constant.

I wanted to submit such a change, but turned out code has a huge number of trivial methods and I wasn't in a mood to do invasive changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions