chore: Bump Rust edition to 2024 (#27800)
Follow-up to https://github.com/zed-industries/zed/pull/27791 Release Notes: - N/A
This commit is contained in:
parent
d50905e000
commit
dc64ec9cc8
802 changed files with 3775 additions and 3662 deletions
|
@ -1,13 +1,13 @@
|
|||
use crate::{
|
||||
db::{
|
||||
tests::{channel_tree, new_test_connection, new_test_user},
|
||||
Channel, ChannelId, ChannelRole, Database, NewUserParams, RoomId, UserId,
|
||||
tests::{channel_tree, new_test_connection, new_test_user},
|
||||
},
|
||||
test_both_dbs,
|
||||
};
|
||||
use rpc::{
|
||||
proto::{self},
|
||||
ConnectionId,
|
||||
proto::{self},
|
||||
};
|
||||
use std::sync::Arc;
|
||||
|
||||
|
@ -142,10 +142,11 @@ async fn test_joining_channels(db: &Arc<Database>) {
|
|||
let room_id = RoomId::from_proto(joined_room.room.id);
|
||||
drop(joined_room);
|
||||
// cannot join a room without membership to its channel
|
||||
assert!(db
|
||||
.join_room(room_id, user_2, ConnectionId { owner_id, id: 1 },)
|
||||
.await
|
||||
.is_err());
|
||||
assert!(
|
||||
db.join_room(room_id, user_2, ConnectionId { owner_id, id: 1 },)
|
||||
.await
|
||||
.is_err()
|
||||
);
|
||||
}
|
||||
|
||||
test_both_dbs!(
|
||||
|
@ -547,8 +548,8 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
|||
db.set_channel_member_role(zed_channel, admin, guest, ChannelRole::Banned)
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(db
|
||||
.transaction(|tx| async move {
|
||||
assert!(
|
||||
db.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
&db.get_channel_internal(public_channel_id, &tx)
|
||||
.await
|
||||
|
@ -559,7 +560,8 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
|||
.await
|
||||
})
|
||||
.await
|
||||
.is_err());
|
||||
.is_err()
|
||||
);
|
||||
|
||||
let (mut members, _) = db
|
||||
.get_channel_participant_details(public_channel_id, "", 100, admin)
|
||||
|
@ -640,8 +642,8 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
|||
})
|
||||
.await
|
||||
.unwrap();
|
||||
assert!(db
|
||||
.transaction(|tx| async move {
|
||||
assert!(
|
||||
db.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
&db.get_channel_internal(internal_channel_id, &tx)
|
||||
.await
|
||||
|
@ -652,7 +654,8 @@ async fn test_user_is_channel_participant(db: &Arc<Database>) {
|
|||
.await
|
||||
})
|
||||
.await
|
||||
.is_err(),);
|
||||
.is_err(),
|
||||
);
|
||||
|
||||
db.transaction(|tx| async move {
|
||||
db.check_user_is_channel_participant(
|
||||
|
@ -720,19 +723,21 @@ async fn test_guest_access(db: &Arc<Database>) {
|
|||
.await
|
||||
.unwrap();
|
||||
|
||||
assert!(db
|
||||
.join_channel_chat(zed_channel, guest_connection, guest)
|
||||
.await
|
||||
.is_err());
|
||||
assert!(
|
||||
db.join_channel_chat(zed_channel, guest_connection, guest)
|
||||
.await
|
||||
.is_err()
|
||||
);
|
||||
|
||||
db.join_channel(zed_channel, guest, guest_connection)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
assert!(db
|
||||
.join_channel_chat(zed_channel, guest_connection, guest)
|
||||
.await
|
||||
.is_ok())
|
||||
assert!(
|
||||
db.join_channel_chat(zed_channel, guest_connection, guest)
|
||||
.await
|
||||
.is_ok()
|
||||
)
|
||||
}
|
||||
|
||||
#[track_caller]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue