1
Fork 0

Add #[must_use] to remaining std functions (A-N)

This commit is contained in:
John Kugelman 2021-10-30 22:58:27 -04:00
parent e249ce6b23
commit e129d49f88
18 changed files with 68 additions and 14 deletions

View file

@ -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 { &[] }