mirror of
https://github.com/tokio-rs/tracing.git
synced 2025-10-02 15:24:47 +00:00
core: update parent() documentation (#1665)
`Event::parent()` and `Span::parent()` returns an `Option`, not boolean.
This commit is contained in:
parent
f5aac47f68
commit
d019e43540
@ -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),
|
||||
|
@ -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),
|
||||
|
Loading…
x
Reference in New Issue
Block a user