Add #[must_use] to remaining std functions (A-N)
This commit is contained in:
parent
e249ce6b23
commit
e129d49f88
18 changed files with 68 additions and 14 deletions
|
@ -110,6 +110,7 @@ use crate::vec::Vec;
|
|||
/// previous point in time. In some instances the `Backtrace` type may
|
||||
/// internally be empty due to configuration. For more information see
|
||||
/// `Backtrace::capture`.
|
||||
#[must_use]
|
||||
pub struct Backtrace {
|
||||
inner: Inner,
|
||||
}
|
||||
|
@ -355,6 +356,7 @@ impl Backtrace {
|
|||
/// Returns the status of this backtrace, indicating whether this backtrace
|
||||
/// request was unsupported, disabled, or a stack trace was actually
|
||||
/// captured.
|
||||
#[must_use]
|
||||
pub fn status(&self) -> BacktraceStatus {
|
||||
match self.inner {
|
||||
Inner::Unsupported => BacktraceStatus::Unsupported,
|
||||
|
@ -366,6 +368,7 @@ impl Backtrace {
|
|||
|
||||
impl<'a> Backtrace {
|
||||
/// Returns an iterator over the backtrace frames.
|
||||
#[must_use]
|
||||
#[unstable(feature = "backtrace_frames", issue = "79676")]
|
||||
pub fn frames(&'a self) -> &'a [BacktraceFrame] {
|
||||
if let Inner::Captured(c) = &self.inner { &c.force().frames } else { &[] }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue