mirror of
https://forgejo.ellis.link/continuwuation/continuwuity.git
synced 2025-08-01 12:48:31 +00:00
run cargo fix for rust 2024 changes and rustfmt
Signed-off-by: June Clementine Strawberry <strawberry@puppygock.gay>
This commit is contained in:
parent
e97952b7f6
commit
a1e1f40ded
320 changed files with 2212 additions and 2039 deletions
|
@ -1,11 +1,11 @@
|
|||
use std::collections::BTreeMap;
|
||||
|
||||
use ruma::{
|
||||
events::{EventContent, MessageLikeEventType, StateEventType, TimelineEventType},
|
||||
MilliSecondsSinceUnixEpoch, OwnedEventId,
|
||||
events::{EventContent, MessageLikeEventType, StateEventType, TimelineEventType},
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use serde_json::value::{to_raw_value, RawValue as RawJsonValue};
|
||||
use serde_json::value::{RawValue as RawJsonValue, to_raw_value};
|
||||
|
||||
use super::StateKey;
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use serde::Deserialize;
|
||||
use serde_json::value::Value as JsonValue;
|
||||
|
||||
use crate::{err, implement, Result};
|
||||
use crate::{Result, err, implement};
|
||||
|
||||
#[must_use]
|
||||
#[implement(super::Pdu)]
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::{cmp::Ordering, fmt, fmt::Display, str::FromStr};
|
|||
|
||||
use ruma::api::Direction;
|
||||
|
||||
use crate::{err, Error, Result};
|
||||
use crate::{Error, Result, err};
|
||||
|
||||
#[derive(Hash, PartialEq, Eq, Clone, Copy, Debug)]
|
||||
pub enum Count {
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use ruma::{events::TimelineEventType, MilliSecondsSinceUnixEpoch, OwnedEventId, RoomId, UserId};
|
||||
use ruma::{MilliSecondsSinceUnixEpoch, OwnedEventId, RoomId, UserId, events::TimelineEventType};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
use super::Pdu;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
use ruma::{CanonicalJsonObject, OwnedEventId, RoomVersionId};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
use crate::{err, Result};
|
||||
use crate::{Result, err};
|
||||
|
||||
/// Generates a correct eventId for the incoming pdu.
|
||||
///
|
||||
|
|
|
@ -17,13 +17,14 @@ mod unsigned;
|
|||
use std::cmp::Ordering;
|
||||
|
||||
use ruma::{
|
||||
events::TimelineEventType, CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId,
|
||||
OwnedRoomId, OwnedServerName, OwnedUserId, UInt,
|
||||
CanonicalJsonObject, CanonicalJsonValue, EventId, OwnedEventId, OwnedRoomId, OwnedServerName,
|
||||
OwnedUserId, UInt, events::TimelineEventType,
|
||||
};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use serde_json::value::RawValue as RawJsonValue;
|
||||
|
||||
pub use self::{
|
||||
Count as PduCount, Id as PduId, Pdu as PduEvent, RawId as RawPduId,
|
||||
builder::{Builder, Builder as PduBuilder},
|
||||
count::Count,
|
||||
event::Event,
|
||||
|
@ -31,7 +32,6 @@ pub use self::{
|
|||
id::*,
|
||||
raw_id::*,
|
||||
state_key::{ShortStateKey, StateKey},
|
||||
Count as PduCount, Id as PduId, Pdu as PduEvent, RawId as RawPduId,
|
||||
};
|
||||
use crate::Result;
|
||||
|
||||
|
|
|
@ -55,8 +55,8 @@ impl RawId {
|
|||
#[must_use]
|
||||
pub fn as_bytes(&self) -> &[u8] {
|
||||
match self {
|
||||
| Self::Normal(ref raw) => raw,
|
||||
| Self::Backfilled(ref raw) => raw,
|
||||
| Self::Normal(raw) => raw,
|
||||
| Self::Backfilled(raw) => raw,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
use ruma::{
|
||||
canonical_json::redact_content_in_place,
|
||||
events::{room::redaction::RoomRedactionEventContent, TimelineEventType},
|
||||
OwnedEventId, RoomVersionId,
|
||||
canonical_json::redact_content_in_place,
|
||||
events::{TimelineEventType, room::redaction::RoomRedactionEventContent},
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use serde_json::{
|
||||
json,
|
||||
value::{to_raw_value, RawValue as RawJsonValue},
|
||||
value::{RawValue as RawJsonValue, to_raw_value},
|
||||
};
|
||||
|
||||
use crate::{implement, Error, Result};
|
||||
use crate::{Error, Result, implement};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct ExtractRedactedBecause {
|
||||
|
@ -76,14 +76,21 @@ pub fn copy_redacts(&self) -> (Option<OwnedEventId>, Box<RawJsonValue>) {
|
|||
if let Ok(mut content) =
|
||||
serde_json::from_str::<RoomRedactionEventContent>(self.content.get())
|
||||
{
|
||||
if let Some(redacts) = content.redacts {
|
||||
return (Some(redacts), self.content.clone());
|
||||
} else if let Some(redacts) = self.redacts.clone() {
|
||||
content.redacts = Some(redacts);
|
||||
return (
|
||||
self.redacts.clone(),
|
||||
to_raw_value(&content).expect("Must be valid, we only added redacts field"),
|
||||
);
|
||||
match content.redacts {
|
||||
| Some(redacts) => {
|
||||
return (Some(redacts), self.content.clone());
|
||||
},
|
||||
| _ => match self.redacts.clone() {
|
||||
| Some(redacts) => {
|
||||
content.redacts = Some(redacts);
|
||||
return (
|
||||
self.redacts.clone(),
|
||||
to_raw_value(&content)
|
||||
.expect("Must be valid, we only added redacts field"),
|
||||
);
|
||||
},
|
||||
| _ => {},
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
use ruma::{
|
||||
events::{
|
||||
room::member::RoomMemberEventContent, space::child::HierarchySpaceChildEvent,
|
||||
AnyEphemeralRoomEvent, AnyMessageLikeEvent, AnyStateEvent, AnyStrippedStateEvent,
|
||||
AnySyncStateEvent, AnySyncTimelineEvent, AnyTimelineEvent, StateEvent,
|
||||
room::member::RoomMemberEventContent, space::child::HierarchySpaceChildEvent,
|
||||
},
|
||||
serde::Raw,
|
||||
};
|
||||
|
|
|
@ -2,10 +2,10 @@ use std::collections::BTreeMap;
|
|||
|
||||
use ruma::MilliSecondsSinceUnixEpoch;
|
||||
use serde::Deserialize;
|
||||
use serde_json::value::{to_raw_value, RawValue as RawJsonValue, Value as JsonValue};
|
||||
use serde_json::value::{RawValue as RawJsonValue, Value as JsonValue, to_raw_value};
|
||||
|
||||
use super::Pdu;
|
||||
use crate::{err, implement, is_true, Result};
|
||||
use crate::{Result, err, implement, is_true};
|
||||
|
||||
#[implement(Pdu)]
|
||||
pub fn remove_transaction_id(&mut self) -> Result {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue