Fix CI by changing where deprecations are added and allowed

This commit is contained in:
Jonas Platte 2024-09-07 10:43:12 +02:00
parent 6a049c93a1
commit 4547da0b7b
5 changed files with 8 additions and 3 deletions

View File

@ -2,6 +2,5 @@
//!
//! Send a join event to a resident server.
#[deprecated = "Since Matrix Server-Server API r0.1.4. Use the v2 endpoint instead."]
pub mod v1;
pub mod v2;

View File

@ -21,6 +21,7 @@ const METADATA: Metadata = metadata! {
/// Request type for the `create_join_event` endpoint.
#[request]
#[deprecated = "Since Matrix Server-Server API r0.1.4. Use the v2 endpoint instead."]
pub struct Request {
/// The room ID that is about to be joined.
///
@ -39,6 +40,7 @@ pub struct Request {
/// Response type for the `create_join_event` endpoint.
#[response]
#[deprecated = "Since Matrix Server-Server API r0.1.4. Use the v2 endpoint instead."]
pub struct Response {
/// Full state and auth chain of the room prior to the join event.
#[ruma_api(body)]
@ -46,6 +48,7 @@ pub struct Response {
pub room_state: RoomState,
}
#[allow(deprecated)]
impl Request {
/// Creates a new `Request` from the given room ID, event ID and PDU.
pub fn new(room_id: OwnedRoomId, event_id: OwnedEventId, pdu: Box<RawJsonValue>) -> Self {
@ -53,6 +56,7 @@ impl Request {
}
}
#[allow(deprecated)]
impl Response {
/// Creates a new `Response` with the given room state.
pub fn new(room_state: RoomState) -> Self {

View File

@ -2,6 +2,5 @@
//!
//! Submit a signed leave event to the receiving server for it to accept it into the room's graph.
#[deprecated = "Since Matrix Server-Server API r0.1.4. Use the v2 endpoint instead."]
pub mod v1;
pub mod v2;

View File

@ -21,6 +21,7 @@ const METADATA: Metadata = metadata! {
/// Request type for the `create_leave_event` endpoint.
#[request]
#[deprecated = "Since Matrix Server-Server API r0.1.4. Use the v2 endpoint instead."]
pub struct Request {
/// The room ID that is about to be left.
///
@ -40,6 +41,7 @@ pub struct Request {
/// Response type for the `create_leave_event` endpoint.
#[response]
#[derive(Default)]
#[deprecated = "Since Matrix Server-Server API r0.1.4. Use the v2 endpoint instead."]
pub struct Response {
/// An empty object.
///
@ -49,6 +51,7 @@ pub struct Response {
pub empty: Empty,
}
#[allow(deprecated)]
impl Request {
/// Creates a new `Request` from the given room ID, event ID and PDU.
pub fn new(room_id: OwnedRoomId, event_id: OwnedEventId, pdu: Box<RawJsonValue>) -> Self {
@ -56,6 +59,7 @@ impl Request {
}
}
#[allow(deprecated)]
impl Response {
/// Creates an empty `Response`.
pub fn new() -> Self {

View File

@ -272,7 +272,6 @@ impl Request {
let path_fields = self.path_fields().map(|f| f.ident.as_ref().unwrap().to_string());
let mut tests = quote! {
#[::std::prelude::v1::test]
#[allow(deprecated)]
fn path_parameters() {
let path_params = super::METADATA._path_parameters();
let request_path_fields: &[&::std::primitive::str] = &[#(#path_fields),*];