core: update parent() documentation (#1665)

`Event::parent()` and `Span::parent()` returns an `Option`, not boolean.
This commit is contained in:
Markus Bergkvist 2021-10-21 19:11:41 +02:00 committed by Eliza Weisman
parent f5aac47f68
commit d019e43540
2 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ impl<'a> Event<'a> {
/// Returns the new event's explicitly-specified parent, if there is one. /// 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), /// 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> { pub fn parent(&self) -> Option<&Id> {
match self.parent { match self.parent {
Parent::Explicit(ref p) => Some(p), Parent::Explicit(ref p) => Some(p),

View File

@ -168,7 +168,7 @@ impl<'a> Attributes<'a> {
/// Returns the new span's explicitly-specified parent, if there is one. /// 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), /// 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> { pub fn parent(&self) -> Option<&Id> {
match self.parent { match self.parent {
Parent::Explicit(ref p) => Some(p), Parent::Explicit(ref p) => Some(p),