Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inline several methods to make tracing::event! smaller #2555

Merged
merged 1 commit into from
Apr 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tracing-core/src/field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,7 @@ impl FieldSet {
///
/// [`Identifier`]: super::callsite::Identifier
/// [`Callsite`]: super::callsite::Callsite
#[inline]
pub(crate) fn callsite(&self) -> callsite::Identifier {
callsite::Identifier(self.callsite.0)
}
Expand Down Expand Up @@ -734,6 +735,7 @@ impl FieldSet {
}

/// Returns an iterator over the `Field`s in this `FieldSet`.
#[inline]
pub fn iter(&self) -> Iter {
let idxs = 0..self.len();
Iter {
Expand Down Expand Up @@ -837,6 +839,7 @@ impl PartialEq for FieldSet {

impl Iterator for Iter {
type Item = Field;
#[inline]
fn next(&mut self) -> Option<Field> {
let i = self.idxs.next()?;
Some(Field {
Expand Down
1 change: 1 addition & 0 deletions tracing-core/src/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ impl<'a> Metadata<'a> {
}

/// Returns the names of the fields on the described span or event.
#[inline]
pub fn fields(&self) -> &field::FieldSet {
&self.fields
}
Expand Down
2 changes: 1 addition & 1 deletion tracing/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2314,7 +2314,7 @@ macro_rules! valueset {
)
};

// Remainder is unparseable, but exists --- must be format args!
// Remainder is unparsable, but exists --- must be format args!
(@ { $(,)* $($out:expr),* }, $next:expr, $($rest:tt)+) => {
$crate::valueset!(@ { (&$next, Some(&format_args!($($rest)+) as &dyn Value)), $($out),* }, $next, )
};
Expand Down