Skip to content

Commit

Permalink
core: update parent() documentation (#1665)
Browse files Browse the repository at this point in the history
`Event::parent()` and `Span::parent()` returns an `Option`, not boolean.
  • Loading branch information
mbergkvist authored and hawkw committed Oct 22, 2021
1 parent f5aac47 commit d019e43
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tracing-core/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl<'a> Event<'a> {
/// Returns the new event's explicitly-specified parent, if there is one.
///
/// Otherwise (if the new event is a root or is a child of the current span),
/// returns false.
/// returns `None`.
pub fn parent(&self) -> Option<&Id> {
match self.parent {
Parent::Explicit(ref p) => Some(p),
Expand Down
2 changes: 1 addition & 1 deletion tracing-core/src/span.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ impl<'a> Attributes<'a> {
/// Returns the new span's explicitly-specified parent, if there is one.
///
/// Otherwise (if the new span is a root or is a child of the current span),
/// returns false.
/// returns `None`.
pub fn parent(&self) -> Option<&Id> {
match self.parent {
Parent::Explicit(ref p) => Some(p),
Expand Down

0 comments on commit d019e43

Please sign in to comment.