mirror of
https://github.com/apple/swift-system
synced 2026-11-26 04:57:54 +00:00
Add some comments and remove leftover WIP noise.
This commit is contained in:
2 files changed
+10
-9
No files matched your search
@@ -59,15 +59,6 @@ public struct FilePath: Sendable {
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
extension FilePath: Hashable, Codable {
|
||||
|
||||
|
||||
precondition(_hasRoot == (self.root != nil))
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
|
||||
extension FilePath {
|
||||
/// The length of the file path, excluding the null terminator.
|
||||
@@ -76,6 +67,11 @@ extension FilePath {
|
||||
|
||||
@available(/*System 0.0.1: macOS 11.0, iOS 14.0, watchOS 7.0, tvOS 14.0*/iOS 8, *)
|
||||
extension FilePath: Hashable, Codable {
|
||||
// Encoder is synthesized; it probably should have been explicit and used
|
||||
// a single-value container, but making that change now is somewhat risky.
|
||||
|
||||
// Decoder is written explicitly to ensure that we validate invariants on
|
||||
// untrusted input.
|
||||
public init(from decoder: any Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self._storage = try container.decode(SystemString.self, forKey: ._storage)
|
||||
|
||||
@@ -174,6 +174,11 @@ extension SystemString: RangeReplaceableCollection {
|
||||
}
|
||||
|
||||
extension SystemString: Hashable, Codable {
|
||||
// Encoder is synthesized; it probably should have been explicit and used
|
||||
// a single-value container, but making that change now is somewhat risky.
|
||||
|
||||
// Decoder is written explicitly to ensure that we validate invariants on
|
||||
// untrusted input.
|
||||
public init(from decoder: any Decoder) throws {
|
||||
let container = try decoder.container(keyedBy: CodingKeys.self)
|
||||
self.nullTerminatedStorage = try container.decode(
|
||||
|
||||
Reference in new issue
Block a user