1
Fork 0

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 { if let Type = state {
drop(c);
type_ = at.slice_between(next).unwrap(); type_ = at.slice_between(next).unwrap();
// Don't use `move_to!` here, as we *can* be at the end of the input. // Don't use `move_to!` here, as we *can* be at the end of the input.
at = next; at = next;
} }
drop(c); let _ = c; // to avoid never used value
drop(next);
end = at; end = at;
let position = InnerSpan::new(start.at, 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 fut = Pin::new(&mut fut);
/// ///
/// let num = fut.poll(cx).ready()?; /// let num = fut.poll(cx).ready()?;
/// # drop(num); /// # let _ = num; // to silence unused warning
/// // ... use num /// // ... use num
/// ///
/// Poll::Ready(()) /// Poll::Ready(())

View file

@ -22,7 +22,7 @@ use core::task::Poll;
/// let fut = Pin::new(&mut fut); /// let fut = Pin::new(&mut fut);
/// ///
/// let num = ready!(fut.poll(cx)); /// let num = ready!(fut.poll(cx));
/// # drop(num); /// # let _ = num;
/// // ... use num /// // ... use num
/// ///
/// Poll::Ready(()) /// Poll::Ready(())
@ -44,7 +44,7 @@ use core::task::Poll;
/// Poll::Ready(t) => t, /// Poll::Ready(t) => t,
/// Poll::Pending => return Poll::Pending, /// Poll::Pending => return Poll::Pending,
/// }; /// };
/// # drop(num); /// # let _ = num; // to silence unused warning
/// # // ... use num /// # // ... use num
/// # /// #
/// # Poll::Ready(()) /// # 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. // Lazily, the first time this gets called, run the actual string formatting.
self.string.get_or_insert_with(|| { self.string.get_or_insert_with(|| {
let mut s = String::new(); let mut s = String::new();
drop(s.write_fmt(*inner)); let _err = s.write_fmt(*inner);
s s
}) })
} }