Skip to content

Commit d019e43

Browse files
mbergkvisthawkw
authored andcommitted
core: update parent() documentation (#1665)
`Event::parent()` and `Span::parent()` returns an `Option`, not boolean.
1 parent f5aac47 commit d019e43

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tracing-core/src/event.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl<'a> Event<'a> {
118118
/// Returns the new event's explicitly-specified parent, if there is one.
119119
///
120120
/// Otherwise (if the new event is a root or is a child of the current span),
121-
/// returns false.
121+
/// returns `None`.
122122
pub fn parent(&self) -> Option<&Id> {
123123
match self.parent {
124124
Parent::Explicit(ref p) => Some(p),

tracing-core/src/span.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ impl<'a> Attributes<'a> {
168168
/// Returns the new span's explicitly-specified parent, if there is one.
169169
///
170170
/// Otherwise (if the new span is a root or is a child of the current span),
171-
/// returns false.
171+
/// returns `None`.
172172
pub fn parent(&self) -> Option<&Id> {
173173
match self.parent {
174174
Parent::Explicit(ref p) => Some(p),

0 commit comments

Comments
 (0)