Bug 1628715 - Part 3: Make fallible nsTArray::Assign nodiscard. r=xpcom-reviewers,erahm

Differential Revision: https://phabricator.services.mozilla.com/D70384
This commit is contained in:
Simon Giesecke 2020-04-24 13:25:13 +00:00
Родитель 3ff0c697d3
Коммит 93004ea958
2 изменённых файлов: 3 добавлений и 3 удалений

Просмотреть файл

@ -44,7 +44,7 @@ TEST(PrioEncoder, BooleanLimitExceeded)
*(sequence.AppendElement(mozilla::fallible)) = rand() % 2;
}
prioParams.mBooleans.Assign(sequence);
ASSERT_TRUE(prioParams.mBooleans.Assign(sequence));
mozilla::dom::RootedDictionary<mozilla::dom::PrioEncodedData> prioEncodedData(
cx);
@ -183,7 +183,7 @@ TEST(PrioEncoder, VerifyFull)
*(sequence.AppendElement(mozilla::fallible)) = dataItems[0];
*(sequence.AppendElement(mozilla::fallible)) = dataItems[1];
*(sequence.AppendElement(mozilla::fallible)) = dataItems[2];
prioParams.mBooleans.Assign(sequence);
ASSERT_TRUE(prioParams.mBooleans.Assign(sequence));
mozilla::dom::RootedDictionary<mozilla::dom::PrioEncodedData> prioEncodedData(
cx);

Просмотреть файл

@ -1467,7 +1467,7 @@ class nsTArray_Impl
//
template <class Allocator, typename ActualAlloc = Alloc>
typename ActualAlloc::ResultType Assign(
[[nodiscard]] typename ActualAlloc::ResultType Assign(
const nsTArray_Impl<E, Allocator>& aOther) {
return ActualAlloc::ConvertBoolToResultType(
!!ReplaceElementsAt<E, ActualAlloc>(0, Length(), aOther.Elements(),