Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(base): Remove impl From for SyncTimelineEvent #4146

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

richvdh
Copy link
Member

@richvdh richvdh commented Oct 17, 2024

I feel like the ability to convert straight from a Raw<AnySyncTimelineEvent>> into a SyncTimelineEvent is somewhat over-simplified: the two are only occasionally equivalent, and it's better to be explicit.

@@ -183,15 +183,15 @@ impl TestTimeline {
C: RedactedMessageLikeEventContent,
{
let ev = self.event_builder.make_sync_redacted_message_event(sender, content);
self.handle_live_event(Raw::new(&ev).unwrap().cast()).await;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given that ev was already a Raw<AnySyncTimelineEvent>, I don't know what the whole Raw::new(&ev).unwrap().cast() was supposed to achieve here. I think we can just get rid of it.

Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.73%. Comparing base (a901506) to head (b2d3897).
Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4146      +/-   ##
==========================================
- Coverage   84.76%   84.73%   -0.04%     
==========================================
  Files         269      269              
  Lines       28848    28841       -7     
==========================================
- Hits        24453    24437      -16     
- Misses       4395     4404       +9     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@richvdh richvdh marked this pull request as ready for review October 17, 2024 15:58
@richvdh richvdh requested a review from a team as a code owner October 17, 2024 15:58
@richvdh richvdh requested review from stefanceriu and removed request for a team October 17, 2024 15:58
@stefanceriu stefanceriu requested review from bnjbvr and removed request for stefanceriu October 21, 2024 06:13
Copy link
Member

@bnjbvr bnjbvr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

I feel like the ability to convert straight from a `Raw<AnySyncTimelineEvent>>`
into a `SyncTimelineEvent` is somewhat over-simplified: the two are only
occasionally equivalent, and it's better to be explicit.

Changelog: `SyncTimelineEvent` no longer implements `From<Raw<AnySyncTimelineEvent>>`.
@richvdh richvdh enabled auto-merge (rebase) October 21, 2024 11:33
@richvdh richvdh merged commit 0c26988 into main Oct 21, 2024
39 checks passed
@richvdh richvdh deleted the rav/remove_impl_from branch October 21, 2024 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants