Files that import struct NIO.ByteBuffer but never name it:
for f in $(git grep -l '^import struct NIO.ByteBuffer$' -- Sources Tests); do
grep -v '^import struct NIO.ByteBuffer$' $f | grep -q ByteBuffer || echo $f
done
Each loses the import line, and a now-doubled blank line.
As EncodeBuffer methods, `self.write(if:) { self.write… }` borrows the
buffer while the closure mutates it, forcing a copy and a CoW on the
first write inside the closure.
Hand edit: Sources/NIOIMAPCore/ByteBuffer+WriteLiteral.swift, which
defines the free functions. Call sites converted with:
git ls-files -z 'Sources/*.swift' 'Tests/*.swift' | xargs -0 perl -pi -e \
's/\b(?:self\.buffer|self|buffer)\.(writeIfExists\(|write\(if:)/$1/g'
* [CI] Adopt GitHub Actions
# Motivation
We want to adopt GitHub actions in all of our Swift repositories to replace our current Jenkins CI.
# Modification
This PR adopts the reusable workflows from NIO and the swiftlang organization to ensure soundness and test coverage. Additionally, this PR enables a sematic label check and adds a `release.yml` to make releasing this package easy.
# Result
Modern CI and release flow.
With this PR the implementation of `CustomDebugStringConvertible` generally uses new `makeDescription` convenience methods on the three encode buffers, e.g.:
```swift
extension ResponseEncodeBuffer {
static func makeDescription(_ closure: (inout ResponseEncodeBuffer) -> Void) -> String
}
```
such that conformance can be implemented as e.g.
```swift
extension Command: CustomDebugStringConvertible {
public var debugDescription: String {
CommandEncodeBuffer.makeDescription {
$0.writeCommand(self)
}
}
}
```
This also adds `CustomDebugStringConvertible` to `MessageAttribute` and `StreamingKind`.