Remove TryFrom, TryInto imports

They are no longer needed in the 2021 edition.
merge-requests/279/head
Jonas Platte 2 years ago
parent b4755ba15b
commit abb4b4cf0b
No known key found for this signature in database
GPG Key ID: CC154DE0E30B7C67

@ -1,12 +1,7 @@
use crate::{utils, Error, Result}; use crate::{utils, Error, Result};
use bytes::BytesMut; use bytes::BytesMut;
use ruma::api::{IncomingResponse, OutgoingRequest, SendAccessToken}; use ruma::api::{IncomingResponse, OutgoingRequest, SendAccessToken};
use std::{ use std::{fmt::Debug, mem, time::Duration};
convert::{TryFrom, TryInto},
fmt::Debug,
mem,
time::Duration,
};
use tracing::warn; use tracing::warn;
pub(crate) async fn send_request<T: OutgoingRequest>( pub(crate) async fn send_request<T: OutgoingRequest>(

@ -1,4 +1,4 @@
use std::{collections::BTreeMap, convert::TryInto, sync::Arc}; use std::{collections::BTreeMap, sync::Arc};
use super::{DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH}; use super::{DEVICE_ID_LENGTH, SESSION_ID_LENGTH, TOKEN_LENGTH};
use crate::{database::DatabaseGuard, pdu::PduBuilder, utils, ConduitResult, Error, Ruma}; use crate::{database::DatabaseGuard, pdu::PduBuilder, utils, ConduitResult, Error, Ruma};

@ -3,7 +3,7 @@ use ruma::{
api::client::{error::ErrorKind, r0::context::get_context}, api::client::{error::ErrorKind, r0::context::get_context},
events::EventType, events::EventType,
}; };
use std::{collections::HashSet, convert::TryFrom}; use std::collections::HashSet;
#[cfg(feature = "conduit_bin")] #[cfg(feature = "conduit_bin")]
use rocket::get; use rocket::get;

@ -1,5 +1,3 @@
use std::convert::TryInto;
use crate::{database::DatabaseGuard, ConduitResult, Database, Error, Result, Ruma}; use crate::{database::DatabaseGuard, ConduitResult, Database, Error, Result, Ruma};
use ruma::{ use ruma::{
api::{ api::{

@ -9,7 +9,6 @@ use ruma::api::client::{
get_media_config, get_media_config,
}, },
}; };
use std::convert::TryInto;
#[cfg(feature = "conduit_bin")] #[cfg(feature = "conduit_bin")]
use rocket::{get, post}; use rocket::{get, post};

@ -30,7 +30,6 @@ use ruma::{
use serde_json::value::{to_raw_value, RawValue as RawJsonValue}; use serde_json::value::{to_raw_value, RawValue as RawJsonValue};
use std::{ use std::{
collections::{hash_map::Entry, BTreeMap, HashMap, HashSet}, collections::{hash_map::Entry, BTreeMap, HashMap, HashSet},
convert::{TryFrom, TryInto},
iter, iter,
sync::{Arc, RwLock}, sync::{Arc, RwLock},
time::{Duration, Instant}, time::{Duration, Instant},

@ -8,7 +8,6 @@ use ruma::{
}; };
use std::{ use std::{
collections::{BTreeMap, HashSet}, collections::{BTreeMap, HashSet},
convert::TryInto,
sync::Arc, sync::Arc,
}; };

@ -1,6 +1,6 @@
use crate::{database::DatabaseGuard, utils, ConduitResult, Ruma}; use crate::{database::DatabaseGuard, utils, ConduitResult, Ruma};
use ruma::api::client::r0::presence::{get_presence, set_presence}; use ruma::api::client::r0::presence::{get_presence, set_presence};
use std::{convert::TryInto, time::Duration}; use std::time::Duration;
#[cfg(feature = "conduit_bin")] #[cfg(feature = "conduit_bin")]
use rocket::{get, put}; use rocket::{get, put};

@ -12,7 +12,7 @@ use ruma::{
events::{room::member::RoomMemberEventContent, EventType}, events::{room::member::RoomMemberEventContent, EventType},
}; };
use serde_json::value::to_raw_value; use serde_json::value::to_raw_value;
use std::{convert::TryInto, sync::Arc}; use std::sync::Arc;
#[cfg(feature = "conduit_bin")] #[cfg(feature = "conduit_bin")]
use rocket::{get, put}; use rocket::{get, put};

@ -27,7 +27,7 @@ use ruma::{
RoomAliasId, RoomId, RoomVersionId, RoomAliasId, RoomId, RoomVersionId,
}; };
use serde_json::{json, value::to_raw_value}; use serde_json::{json, value::to_raw_value};
use std::{cmp::max, collections::BTreeMap, convert::TryInto, sync::Arc}; use std::{cmp::max, collections::BTreeMap, sync::Arc};
use tracing::{info, warn}; use tracing::{info, warn};
#[cfg(feature = "conduit_bin")] #[cfg(feature = "conduit_bin")]

@ -14,7 +14,6 @@ use ruma::{
}; };
use std::{ use std::{
collections::{hash_map::Entry, BTreeMap, HashMap, HashSet}, collections::{hash_map::Entry, BTreeMap, HashMap, HashSet},
convert::TryInto,
sync::Arc, sync::Arc,
time::Duration, time::Duration,
}; };

@ -28,7 +28,6 @@ use ruma::{DeviceId, EventId, RoomId, ServerName, UserId};
use serde::{de::IgnoredAny, Deserialize}; use serde::{de::IgnoredAny, Deserialize};
use std::{ use std::{
collections::{BTreeMap, HashMap, HashSet}, collections::{BTreeMap, HashMap, HashSet},
convert::{TryFrom, TryInto},
fs::{self, remove_dir_all}, fs::{self, remove_dir_all},
io::Write, io::Write,
mem::size_of, mem::size_of,

@ -6,7 +6,7 @@ use ruma::{
RoomId, UserId, RoomId, UserId,
}; };
use serde::{de::DeserializeOwned, Serialize}; use serde::{de::DeserializeOwned, Serialize};
use std::{collections::HashMap, convert::TryFrom, sync::Arc}; use std::{collections::HashMap, sync::Arc};
use super::abstraction::Tree; use super::abstraction::Tree;

@ -1,4 +1,4 @@
use std::{convert::TryInto, sync::Arc}; use std::sync::Arc;
use crate::{pdu::PduBuilder, Database}; use crate::{pdu::PduBuilder, Database};
use rocket::futures::{channel::mpsc, stream::StreamExt}; use rocket::futures::{channel::mpsc, stream::StreamExt};

@ -19,7 +19,7 @@ use ruma::{
}; };
use tracing::{error, info, warn}; use tracing::{error, info, warn};
use std::{convert::TryFrom, fmt::Debug, mem, sync::Arc}; use std::{fmt::Debug, mem, sync::Arc};
use super::abstraction::Tree; use super::abstraction::Tree;

@ -35,7 +35,6 @@ use serde_json::value::to_raw_value;
use std::{ use std::{
borrow::Cow, borrow::Cow,
collections::{BTreeMap, HashMap, HashSet}, collections::{BTreeMap, HashMap, HashSet},
convert::{TryFrom, TryInto},
fmt::Debug, fmt::Debug,
iter, iter,
mem::size_of, mem::size_of,

@ -11,7 +11,6 @@ use ruma::{
}; };
use std::{ use std::{
collections::{HashMap, HashSet}, collections::{HashMap, HashSet},
convert::TryInto,
mem, mem,
sync::Arc, sync::Arc,
}; };

@ -1,6 +1,5 @@
use std::{ use std::{
collections::{BTreeMap, HashMap, HashSet}, collections::{BTreeMap, HashMap, HashSet},
convert::TryInto,
fmt::Debug, fmt::Debug,
sync::Arc, sync::Arc,
time::{Duration, Instant}, time::{Duration, Instant},

@ -11,12 +11,7 @@ use ruma::{
DeviceId, DeviceKeyAlgorithm, DeviceKeyId, MilliSecondsSinceUnixEpoch, RoomAliasId, UInt, DeviceId, DeviceKeyAlgorithm, DeviceKeyId, MilliSecondsSinceUnixEpoch, RoomAliasId, UInt,
UserId, UserId,
}; };
use std::{ use std::{collections::BTreeMap, mem, sync::Arc};
collections::BTreeMap,
convert::{TryFrom, TryInto},
mem,
sync::Arc,
};
use tracing::warn; use tracing::warn;
use super::abstraction::Tree; use super::abstraction::Tree;

@ -12,7 +12,7 @@ use serde_json::{
json, json,
value::{to_raw_value, RawValue as RawJsonValue}, value::{to_raw_value, RawValue as RawJsonValue},
}; };
use std::{cmp::Ordering, collections::BTreeMap, convert::TryInto, sync::Arc}; use std::{cmp::Ordering, collections::BTreeMap, sync::Arc};
use tracing::warn; use tracing::warn;
/// Content hashes of a PDU. /// Content hashes of a PDU.

@ -60,7 +60,6 @@ use ruma::{
use serde_json::value::{to_raw_value, RawValue as RawJsonValue}; use serde_json::value::{to_raw_value, RawValue as RawJsonValue};
use std::{ use std::{
collections::{btree_map, hash_map, BTreeMap, BTreeSet, HashMap, HashSet}, collections::{btree_map, hash_map, BTreeMap, BTreeSet, HashMap, HashSet},
convert::{TryFrom, TryInto},
fmt::Debug, fmt::Debug,
future::Future, future::Future,
mem, mem,

@ -4,7 +4,6 @@ use rand::prelude::*;
use ruma::serde::{try_from_json_map, CanonicalJsonError, CanonicalJsonObject}; use ruma::serde::{try_from_json_map, CanonicalJsonError, CanonicalJsonObject};
use std::{ use std::{
cmp, cmp,
convert::TryInto,
str::FromStr, str::FromStr,
time::{SystemTime, UNIX_EPOCH}, time::{SystemTime, UNIX_EPOCH},
}; };

Loading…
Cancel
Save