mirror of
https://github.com/apple/swift-collections
synced 2026-11-28 05:04:21 +00:00
[BasicContainers, ContainersPreview, DequeModule] More SuppressedAssociatedTypesWithDefaults fixups
This commit is contained in:
26 files changed
+129
-42
No files matched your search
@@ -204,7 +204,9 @@ extension RigidDeque where Element: ~Copyable {
|
||||
>(
|
||||
addingCount newItemCount: Int,
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
try self.append(addingCount: newItemCount) { target throws(E) in
|
||||
while !target.isFull {
|
||||
guard try producer.generate(into: &target) else { break }
|
||||
@@ -229,7 +231,9 @@ extension RigidDeque where Element: ~Copyable {
|
||||
P: Producer<Element, E> & ~Copyable & ~Escapable
|
||||
>(
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
var done = false
|
||||
try self.append(
|
||||
addingCount: freeCapacity
|
||||
|
||||
@@ -90,7 +90,9 @@ extension RigidDeque where Element: ~Copyable {
|
||||
>(
|
||||
capacity: Int,
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
self.init(capacity: capacity)
|
||||
try self.append(from: &producer)
|
||||
}
|
||||
|
||||
@@ -245,7 +245,9 @@ extension RigidDeque where Element: ~Copyable {
|
||||
addingCount newItemCount: Int,
|
||||
from producer: inout P,
|
||||
at index: Int
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
try insert(addingCount: newItemCount, at: index) { target throws(E) in
|
||||
while !target.isFull, try producer.generate(into: &target) {
|
||||
// Do nothing
|
||||
|
||||
@@ -215,7 +215,9 @@ extension RigidDeque where Element: ~Copyable {
|
||||
>(
|
||||
addingCount newItemCount: Int? = nil,
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
try self.prepend(
|
||||
addingCount: newItemCount ?? freeCapacity
|
||||
) { target throws(E) in
|
||||
|
||||
@@ -325,7 +325,9 @@ extension RigidDeque where Element: ~Copyable {
|
||||
removing subrange: Range<Int>,
|
||||
addingCount newItemCount: Int,
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
try replace(
|
||||
removing: subrange,
|
||||
addingCount: newItemCount
|
||||
|
||||
@@ -195,7 +195,9 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
>(
|
||||
addingCount newItemCount: Int,
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
_ensureFreeCapacity(newItemCount)
|
||||
try _storage.append(addingCount: newItemCount, from: &producer)
|
||||
}
|
||||
@@ -219,7 +221,9 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
P: Producer<Element, E> & ~Copyable & ~Escapable
|
||||
>(
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
var done = false
|
||||
while !done {
|
||||
let c = Swift.max(producer.underestimatedCount, 1)
|
||||
|
||||
@@ -93,7 +93,9 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
>(
|
||||
capacity: Int,
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
self.init(capacity: capacity)
|
||||
try self.append(addingCount: capacity, from: &producer)
|
||||
}
|
||||
@@ -113,7 +115,9 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
P: Producer<Element, E> & ~Copyable & ~Escapable
|
||||
>(
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
self.init(capacity: producer.underestimatedCount)
|
||||
try self.append(from: &producer)
|
||||
}
|
||||
|
||||
@@ -257,7 +257,9 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
addingCount newItemCount: Int,
|
||||
from producer: inout P,
|
||||
at index: Int
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
try insert(addingCount: newItemCount, at: index) { target throws(E) in
|
||||
while !target.isFull, try producer.generate(into: &target) {
|
||||
// Do nothing
|
||||
|
||||
@@ -206,7 +206,9 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
>(
|
||||
addingCount newItemCount: Int,
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
_ensureFreeCapacity(newItemCount)
|
||||
try _storage._handle.uncheckedPrepend(
|
||||
addingCount: newItemCount
|
||||
@@ -237,7 +239,9 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
P: Producer<Element, E> & ~Copyable & ~Escapable
|
||||
>(
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
var done = false
|
||||
while !done {
|
||||
let c = Swift.max(producer.underestimatedCount, 1)
|
||||
|
||||
@@ -334,7 +334,9 @@ extension UniqueDeque where Element: ~Copyable {
|
||||
removing subrange: Range<Int>,
|
||||
addingCount newItemCount: Int,
|
||||
from producer: inout P
|
||||
) throws(E) {
|
||||
) throws(E)
|
||||
where P.Element: ~Copyable
|
||||
{
|
||||
try replace(removing: subrange, addingCount: newItemCount) { target throws(E) in
|
||||
while !target.isFull, try producer.generate(into: &target) {
|
||||
// Do nothing
|
||||
|
||||
Reference in new issue
Block a user