mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-04-26 02:01:00 -04:00
Handle another new clippy lint
Issue about false positives: https://github.com/rust-lang/rust-clippy/issues/10482
This commit is contained in:
committed by
Jonas Platte
parent
595e34aad5
commit
8d83a996a6
@@ -147,7 +147,7 @@ impl AuthenticationService {
|
||||
})
|
||||
.map_err(AuthenticationError::from)?;
|
||||
|
||||
let details = RUNTIME.block_on(async { self.details_from_client(&client).await })?;
|
||||
let details = RUNTIME.block_on(self.details_from_client(&client))?;
|
||||
|
||||
// Now we've verified that it's a valid homeserver, make sure
|
||||
// there's a sliding sync proxy available one way or another.
|
||||
|
||||
@@ -377,7 +377,8 @@ impl Client {
|
||||
impl Client {
|
||||
/// The homeserver this client is configured to use.
|
||||
pub fn homeserver(&self) -> String {
|
||||
RUNTIME.block_on(async move { self.async_homeserver().await })
|
||||
#[allow(unknown_lints, clippy::redundant_async_block)] // false positive
|
||||
RUNTIME.block_on(self.async_homeserver())
|
||||
}
|
||||
|
||||
pub fn rooms(&self) -> Vec<Arc<Room>> {
|
||||
|
||||
@@ -250,7 +250,8 @@ impl Room {
|
||||
.unwrap()
|
||||
.get_or_insert_with(|| {
|
||||
let room = self.room.clone();
|
||||
let timeline = RUNTIME.block_on(async move { room.timeline().await });
|
||||
#[allow(unknown_lints, clippy::redundant_async_block)] // false positive
|
||||
let timeline = RUNTIME.block_on(room.timeline());
|
||||
Arc::new(timeline)
|
||||
})
|
||||
.clone();
|
||||
|
||||
@@ -194,8 +194,8 @@ impl SlidingSyncRoom {
|
||||
}
|
||||
};
|
||||
|
||||
let (timeline_items, timeline_stream) =
|
||||
RUNTIME.block_on(async { timeline.subscribe().await });
|
||||
#[allow(unknown_lints, clippy::redundant_async_block)] // false positive
|
||||
let (timeline_items, timeline_stream) = RUNTIME.block_on(timeline.subscribe());
|
||||
|
||||
let handle_events = async move {
|
||||
let listener: Arc<dyn TimelineListener> = listener.into();
|
||||
|
||||
@@ -1066,6 +1066,7 @@ pub(crate) mod tests {
|
||||
|
||||
let listener = manager.listen_for_received_queries();
|
||||
|
||||
#[allow(unknown_lints, clippy::redundant_async_block)] // false positive
|
||||
let task = tokio::task::spawn(async move { listener.wait(Duration::from_secs(10)).await });
|
||||
|
||||
manager
|
||||
|
||||
@@ -543,6 +543,7 @@ async fn fetch_members_deduplication() {
|
||||
|
||||
// Create N tasks that try to fetch the members.
|
||||
for _ in 0..5 {
|
||||
#[allow(unknown_lints, clippy::redundant_async_block)] // false positive
|
||||
let task = tokio::spawn({
|
||||
let room = room.clone();
|
||||
async move { room.sync_members().await }
|
||||
|
||||
@@ -180,6 +180,7 @@ async fn echo() {
|
||||
|
||||
// Don't move the original timeline, it must live until the end of the test
|
||||
let timeline = timeline.clone();
|
||||
#[allow(unknown_lints, clippy::redundant_async_block)] // false positive
|
||||
let send_hdl = spawn(async move {
|
||||
timeline
|
||||
.send(RoomMessageEventContent::text_plain("Hello, World!").into(), Some(txn_id))
|
||||
|
||||
Reference in New Issue
Block a user