Remove useless drop of copy type

This commit is contained in:
Urgau 2023-03-27 19:29:50 +02:00
parent d36e390d81
commit 7dab6094bb
4 changed files with 5 additions and 7 deletions

View File

@ -562,15 +562,13 @@ pub(crate) mod printf {
}
if let Type = state {
drop(c);
type_ = at.slice_between(next).unwrap();
// Don't use `move_to!` here, as we *can* be at the end of the input.
at = next;
}
drop(c);
drop(next);
let _ = c; // to avoid never used value
end = at;
let position = InnerSpan::new(start.at, end.at);

View File

@ -116,7 +116,7 @@ impl<T> Poll<T> {
/// let fut = Pin::new(&mut fut);
///
/// let num = fut.poll(cx).ready()?;
/// # drop(num);
/// # let _ = num; // to silence unused warning
/// // ... use num
///
/// Poll::Ready(())

View File

@ -22,7 +22,7 @@ use core::task::Poll;
/// let fut = Pin::new(&mut fut);
///
/// let num = ready!(fut.poll(cx));
/// # drop(num);
/// # let _ = num;
/// // ... use num
///
/// Poll::Ready(())
@ -44,7 +44,7 @@ use core::task::Poll;
/// Poll::Ready(t) => t,
/// Poll::Pending => return Poll::Pending,
/// };
/// # drop(num);
/// # let _ = num; // to silence unused warning
/// # // ... use num
/// #
/// # Poll::Ready(())

View File

@ -541,7 +541,7 @@ pub fn begin_panic_handler(info: &PanicInfo<'_>) -> ! {
// Lazily, the first time this gets called, run the actual string formatting.
self.string.get_or_insert_with(|| {
let mut s = String::new();
drop(s.write_fmt(*inner));
let _err = s.write_fmt(*inner);
s
})
}