Skip to content

Commit

Permalink
pinned events(refactor): rename event_with_config to fetch_event
Browse files Browse the repository at this point in the history
The `with_config` is now redundant, and `fetch` makes it clear it's
hitting network.
  • Loading branch information
bnjbvr committed Aug 12, 2024
1 parent e15ddf6 commit 5954ee1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions crates/matrix-sdk-ui/src/timeline/pinned_events_loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl PinnedEventsLoader {
let new_events = join_all(event_ids_to_request.into_iter().map(|event_id| {
let provider = Arc::clone(&provider);
async move {
match provider.event_with_config(&event_id, request_config).await {
match provider.fetch_event(&event_id, request_config).await {
Ok(event) => Some(event),
Err(err) => {
warn!("error when loading pinned event: {err}");
Expand Down Expand Up @@ -124,7 +124,7 @@ impl PinnedEventsLoader {
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
pub trait PinnedEventsRoom: SendOutsideWasm + SyncOutsideWasm {
/// Load a single room event.
async fn event_with_config(
async fn fetch_event(
&self,
event_id: &EventId,
request_config: Option<RequestConfig>,
Expand All @@ -143,7 +143,7 @@ pub trait PinnedEventsRoom: SendOutsideWasm + SyncOutsideWasm {
#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
impl PinnedEventsRoom for Room {
async fn event_with_config(
async fn fetch_event(
&self,
event_id: &EventId,
request_config: Option<RequestConfig>,
Expand Down
2 changes: 1 addition & 1 deletion crates/matrix-sdk-ui/src/timeline/tests/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ impl PaginableRoom for TestRoomDataProvider {
#[cfg_attr(target_arch = "wasm32", async_trait::async_trait(?Send))]
#[cfg_attr(not(target_arch = "wasm32"), async_trait::async_trait)]
impl PinnedEventsRoom for TestRoomDataProvider {
async fn event_with_config(
async fn fetch_event(
&self,
_event_id: &EventId,
_config: Option<RequestConfig>,
Expand Down

0 comments on commit 5954ee1

Please sign in to comment.