Skip to content

Commit fba4e63

Browse files
authored
api: Rename Transport to TransportListEntry (#8009)
Follow-up to #7994, in order to prevent clashes with other things that are called `Transport`, and in order to make the struct name more greppable
1 parent 810dab1 commit fba4e63

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

deltachat-jsonrpc/src/api.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ use self::types::{
6868
},
6969
};
7070
use crate::api::types::chat_list::{get_chat_list_item_by_id, ChatListItemFetchResult};
71-
use crate::api::types::login_param::Transport;
71+
use crate::api::types::login_param::TransportListEntry;
7272
use crate::api::types::qr::{QrObject, SecurejoinSource, SecurejoinUiPath};
7373

7474
#[derive(Debug)]
@@ -571,7 +571,7 @@ impl CommandApi {
571571
/// Returns the list of all email accounts that are used as a transport in the current profile.
572572
/// Use [Self::add_or_update_transport()] to add or change a transport
573573
/// and [Self::delete_transport()] to delete a transport.
574-
async fn list_transports_ex(&self, account_id: u32) -> Result<Vec<Transport>> {
574+
async fn list_transports_ex(&self, account_id: u32) -> Result<Vec<TransportListEntry>> {
575575
let ctx = self.get_context(account_id).await?;
576576
let res = ctx
577577
.list_transports()

deltachat-jsonrpc/src/api/types/login_param.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use yerpc::TypeDef;
66

77
#[derive(Serialize, TypeDef, schemars::JsonSchema)]
88
#[serde(rename_all = "camelCase")]
9-
pub struct Transport {
9+
pub struct TransportListEntry {
1010
/// The login data entered by the user.
1111
pub param: EnteredLoginParam,
1212
/// Whether this transport is set to 'unpublished'.
@@ -66,9 +66,9 @@ pub struct EnteredLoginParam {
6666
pub oauth2: Option<bool>,
6767
}
6868

69-
impl From<dc::Transport> for Transport {
70-
fn from(transport: dc::Transport) -> Self {
71-
Transport {
69+
impl From<dc::TransportListEntry> for TransportListEntry {
70+
fn from(transport: dc::TransportListEntry) -> Self {
71+
TransportListEntry {
7272
param: transport.param.into(),
7373
is_unpublished: transport.is_unpublished,
7474
}

src/configure.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ use crate::context::Context;
2929
use crate::imap::Imap;
3030
use crate::log::warn;
3131
pub use crate::login_param::EnteredLoginParam;
32-
use crate::login_param::{EnteredCertificateChecks, Transport};
32+
use crate::login_param::{EnteredCertificateChecks, TransportListEntry};
3333
use crate::message::Message;
3434
use crate::net::proxy::ProxyConfig;
3535
use crate::oauth2::get_oauth2_addr;
@@ -189,7 +189,7 @@ impl Context {
189189
/// Returns the list of all email accounts that are used as a transport in the current profile.
190190
/// Use [Self::add_or_update_transport()] to add or change a transport
191191
/// and [Self::delete_transport()] to delete a transport.
192-
pub async fn list_transports(&self) -> Result<Vec<Transport>> {
192+
pub async fn list_transports(&self) -> Result<Vec<TransportListEntry>> {
193193
let transports = self
194194
.sql
195195
.query_map_vec(
@@ -199,7 +199,7 @@ impl Context {
199199
let param: String = row.get(0)?;
200200
let param: EnteredLoginParam = serde_json::from_str(&param)?;
201201
let is_published: bool = row.get(1)?;
202-
Ok(Transport {
202+
Ok(TransportListEntry {
203203
param,
204204
is_unpublished: !is_published,
205205
})

src/login_param.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ pub struct EnteredServerLoginParam {
8181

8282
/// A transport, as shown in the "relays" list in the UI.
8383
#[derive(Debug)]
84-
pub struct Transport {
84+
pub struct TransportListEntry {
8585
/// The login data entered by the user.
8686
pub param: EnteredLoginParam,
8787
/// Whether this transport is set to 'unpublished'.

0 commit comments

Comments
 (0)