Take Tracks in TimelineBuilder::compile - #125
Conversation
Follows the builder no longer accumulating tracks itself. `Tracks` wraps a `NonEmpty<Track>`, so a timeline can't be built with zero tracks, and `compile` takes `impl Into<Tracks>` with a `From<Track>` impl so the single-track case stays `b.compile(track)`. Multiple tracks go through `Tracks(nonempty![a, b])`, with `nonempty` re-exported from `motiongfx` so callers don't depend on it directly. `CompileError::EmptyTimeline` goes with it - the type now rules that case out, leaving the variant unconstructible.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe PR adds a public non-empty ChangesTimeline compilation API
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Jaghov
left a comment
There was a problem hiding this comment.
Looks good! Although the name Tracks is quite visually similar to track. Maybe TrackList might be better, or just a more distinct name.
Follows the builder no longer accumulating tracks itself. `Tracks` wraps a `NonEmpty<Track>`, so a timeline can't be built with zero tracks, and `compile` takes `impl Into<Tracks>` with a `From<Track>` impl so the single-track case stays `b.compile(track)`. Multiple tracks go through `Tracks(nonempty![a, b])`, with `nonempty` re-exported from `motiongfx` so callers don't depend on it directly. `CompileError::EmptyTimeline` goes with it - the type now rules that case out, leaving the variant unconstructible.
Follows the builder no longer accumulating tracks itself.
Trackswraps aNonEmpty<Track>, so a timeline can't be built with zero tracks, andcompiletakesimpl Into<Tracks>with aFrom<Track>impl so the single-track case staysb.compile(track).Multiple tracks go through
Tracks(nonempty![a, b]), withnonemptyre-exported frommotiongfxso callers don't depend on it directly.CompileError::EmptyTimelinegoes with it - the type now rules that case out, leaving the variant unconstructible.