Skip to content

Replace .init with explicit type names #139

@oleksiikolomiietssnapp

Description

@oleksiikolomiietssnapp

Description

Replace all .init syntax with explicit type names throughout the codebase to improve readability and maintainability.

Problem

The codebase uses .init shorthand in various places. While valid Swift syntax, this requires readers to infer the type from context, adding cognitive load during code review and maintenance.

Solution

Replace .init with explicit type constructors.

Example

self.images = .init(cache: imageCache, configuration: parserConfiguration)
self.colors = .init(cache: colorCache, configuration: parserConfiguration)
self.interactiveColors = .init(cache: interactiveColorsCache, configuration: parserConfiguration)
self.metrics = .init(cache: metricsCache, configuration: parserConfiguration)
self.fonts = .init(cache: fontsCache, configuration: parserConfiguration)

should be

self.images = SnappThemingImageDeclarations(cache: imageCache, configuration: parserConfiguration)
self.colors = SnappThemingColorDeclarations(cache: colorCache, configuration: parserConfiguration)
self.interactiveColors = SnappThemingInteractiveColorDeclarations(cache: interactiveColorsCache, configuration: parserConfiguration)
self.metrics = SnappThemingMetricDeclarations(cache: metricsCache, configuration: parserConfiguration)
self.fonts = SnappThemingFontDeclarations(cache: fontsCache, configuration: parserConfiguration)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions