You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Both types then expose the same six accessors with identical bodies:
Method
types.rs
dimension_registry.rs
base_dim_names
424
169
base_dim_symbols
429
175
format_dimension
437
187
resolve_dim_expr
447
226 (#[cfg(test)])
resolve_dim_expr_detailed
455
233
resolve_type_expr
467
245
Note
The shared logic is already correctly factored into free *_impl functions in dimension_registry.rs (resolve_dim_expr_impl, resolve_dim_expr_detailed_impl, resolve_type_expr_impl, format_dimension_preferring_alias_after_validation). So this is purely six duplicated forwarders plus a duplicated field triple — a small, low-risk cleanup, not a logic duplication.
Suggested fix
Have RegistryBuilder own a DimensionRegistry under construction and delegate to it (or Deref to it for the read methods). build() then moves one field instead of three, and the accessors exist once.
Provenance
Found during a full-workspace code review at 6e462341a (v0.0.1-alpha.27). Baseline at that commit: cargo clippy --workspace --all-targets clean, cargo test --workspace 2926 passed / 0 failed, cargo deny check advisories ok.
Warning
This content was written by an AI agent and must be verified by a human developer. After human verification, this alert may be removed.
Summary
RegistryBuilderholds the same three fields thatDimensionRegistryholds, and re-implements six accessors over them with identical bodies.Detail
crates/graphcal-compiler/src/registry/types.rs:92-96holds them as three loose fields:and
build()(types.rs:125-129) moves them verbatim into the registry:Both types then expose the same six accessors with identical bodies:
types.rsdimension_registry.rsbase_dim_namesbase_dim_symbolsformat_dimensionresolve_dim_expr#[cfg(test)])resolve_dim_expr_detailedresolve_type_exprNote
The shared logic is already correctly factored into free
*_implfunctions indimension_registry.rs(resolve_dim_expr_impl,resolve_dim_expr_detailed_impl,resolve_type_expr_impl,format_dimension_preferring_alias_after_validation). So this is purely six duplicated forwarders plus a duplicated field triple — a small, low-risk cleanup, not a logic duplication.Suggested fix
Have
RegistryBuilderown aDimensionRegistryunder construction and delegate to it (orDerefto it for the read methods).build()then moves one field instead of three, and the accessors exist once.Provenance
Found during a full-workspace code review at
6e462341a(v0.0.1-alpha.27). Baseline at that commit:cargo clippy --workspace --all-targetsclean,cargo test --workspace2926 passed / 0 failed,cargo deny check advisoriesok.