Skip to content

Add Sendable conformance to FileManagerHandler #135

@leogdion

Description

@leogdion

Severity: 🟠 Major
File: Sources/BushelUtilities/FileManager/FileManagerHandler.swift:33
PR: #126

Issue

Per the coding guidelines, all public types must conform to the Sendable protocol for thread safety. Since FileManagerHandler contains only a @Sendable closure, it is safe to mark as Sendable.

Current Code

public struct FileManagerHandler: FileHandler {
  // ...
}

Recommended Fix

public struct FileManagerHandler: FileHandler, Sendable {
  // ...
}

Rationale

  • The coding guidelines require all public types to be Sendable
  • The struct only contains a @Sendable closure, making it inherently thread-safe
  • Adding Sendable conformance is a simple, safe change

CodeRabbit Suggestion

In @Sources/BushelUtilities/FileManager/FileManagerHandler.swift around line 33,
Add Sendable conformance to the public FileManagerHandler type: update the
declaration of the struct FileManagerHandler (the type implementing FileHandler
and holding a @Sendable closure) to also adopt Sendable, i.e., append ",
Sendable" to its protocol list so it becomes "public struct FileManagerHandler:
FileHandler, Sendable"; ensure no other changes are required since its stored
property is already a @Sendable closure.

Source: CodeRabbit AI review of PR #126

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions