Skip to content

Commit cf7bb9b

Browse files
committed
Elide template parameters in swaps where unneeded
1 parent fec1715 commit cf7bb9b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

include/cxx.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ class Vec final {
329329
void set_len(std::size_t len) noexcept;
330330
void drop() noexcept;
331331

332-
friend void swap(Vec<T> &lhs, Vec<T> &rhs) noexcept { lhs.swap(rhs); }
332+
friend void swap(Vec &lhs, Vec &rhs) noexcept { lhs.swap(rhs); }
333333

334334
// Size and alignment statically verified by rust_vec.rs.
335335
std::array<std::uintptr_t, 3> repr;
@@ -768,7 +768,7 @@ Box<T> Box<T>::in_place(Fields &&... fields) {
768768
}
769769

770770
template <typename T>
771-
void Box<T>::swap(Box<T> &rhs) noexcept {
771+
void Box<T>::swap(Box &rhs) noexcept {
772772
using std::swap;
773773
swap(this->ptr, rhs.ptr);
774774
}
@@ -955,7 +955,7 @@ typename Vec<T>::const_iterator Vec<T>::cend() const noexcept {
955955
}
956956

957957
template <typename T>
958-
void Vec<T>::swap(Vec<T> &rhs) noexcept {
958+
void Vec<T>::swap(Vec &rhs) noexcept {
959959
using std::swap;
960960
swap(this->repr, rhs.repr);
961961
}

0 commit comments

Comments
 (0)