Skip to content

Commit

Permalink
ffi: Remove unused public Rust API
Browse files Browse the repository at this point in the history
  • Loading branch information
jplatte committed Jun 15, 2023
1 parent b789b9e commit 53ae436
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 36 deletions.
1 change: 1 addition & 0 deletions bindings/matrix-sdk-ffi/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ impl From<RoomVisibility> for Visibility {
}
}

#[allow(clippy::enum_variant_names)]
pub enum RoomPreset {
/// `join_rules` is set to `invite` and `history_visibility` is set to
/// `shared`.
Expand Down
2 changes: 1 addition & 1 deletion bindings/matrix-sdk-ffi/src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use ruma::events::{
RedactedStateEventContent, StaticStateEventContent, SyncMessageLikeEvent, SyncStateEvent,
};

use crate::{ClientError, MembershipState, MessageType};
use crate::{room_member::MembershipState, timeline::MessageType, ClientError};

pub struct TimelineEvent(pub(crate) AnySyncTimelineEvent);

Expand Down
44 changes: 19 additions & 25 deletions bindings/matrix-sdk-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,34 @@ macro_rules! unwrap_or_clone_arc_into_variant {
};
}

mod platform;

pub mod authentication_service;
pub mod client;
pub mod client_builder;
mod authentication_service;
mod client;
mod client_builder;
mod error;
pub mod event;
mod event;
mod helpers;
pub mod notification;
pub mod room;
pub mod room_list;
pub mod room_member;
pub mod session_verification;
pub mod sliding_sync;
pub mod task_handle;
pub mod timeline;
pub mod tracing;
mod notification;
mod platform;
mod room;
mod room_list;
mod room_member;
mod session_verification;
mod sliding_sync;
mod task_handle;
mod timeline;
mod tracing;

use async_compat::TOKIO1 as RUNTIME;
pub use matrix_sdk::ruma::{api::client::account::register, UserId};
pub use matrix_sdk_ui::timeline::PaginationOutcome;
pub use platform::*;
use matrix_sdk::ruma::events::room::{message::RoomMessageEventContent, MediaSource};

// Re-exports for more convenient use inside other submodules
use self::error::ClientError;
pub use self::{
authentication_service::*, client::*, event::*, notification::*, room::*, room_list::*,
room_member::*, session_verification::*, sliding_sync::*, task_handle::TaskHandle, timeline::*,
tracing::*,
use self::{
client::*, error::ClientError, event::*, notification::*, platform::*, room_list::*,
session_verification::*, sliding_sync::*, task_handle::TaskHandle, timeline::MediaSourceExt,
};

uniffi::include_scaffolding!("api");

#[uniffi::export]
pub fn sdk_git_sha() -> String {
fn sdk_git_sha() -> String {
env!("VERGEN_GIT_SHA").to_owned()
}
8 changes: 6 additions & 2 deletions bindings/matrix-sdk-ffi/src/room.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,12 @@ use tracing::{error, info};
use super::RUNTIME;
use crate::{
error::{ClientError, RoomError},
AudioInfo, FileInfo, ImageInfo, RoomMember, TaskHandle, ThumbnailInfo, TimelineDiff,
TimelineItem, TimelineListener, VideoInfo,
room_member::RoomMember,
timeline::{
AudioInfo, FileInfo, ImageInfo, ThumbnailInfo, TimelineDiff, TimelineItem,
TimelineListener, VideoInfo,
},
TaskHandle,
};

#[derive(uniffi::Enum)]
Expand Down
2 changes: 1 addition & 1 deletion bindings/matrix-sdk-ffi/src/room_list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use futures_util::{pin_mut, StreamExt};
use ruma::RoomId;

use crate::{
Client, EventTimelineItem, Room, RoomListEntry, RoomSubscription, TaskHandle,
room::Room, timeline::EventTimelineItem, Client, RoomListEntry, RoomSubscription, TaskHandle,
UnreadNotificationsCount, RUNTIME,
};

Expand Down
7 changes: 5 additions & 2 deletions bindings/matrix-sdk-ffi/src/sliding_sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,11 @@ use matrix_sdk_ui::timeline::SlidingSyncRoomExt;
use tracing::{error, warn};

use crate::{
error::ClientError, helpers::unwrap_or_clone_arc, room::TimelineLock, Client,
EventTimelineItem, Room, TaskHandle, TimelineDiff, TimelineItem, TimelineListener, RUNTIME,
error::ClientError,
helpers::unwrap_or_clone_arc,
room::{Room, TimelineLock},
timeline::{EventTimelineItem, TimelineDiff, TimelineItem, TimelineListener},
Client, TaskHandle, RUNTIME,
};

#[derive(uniffi::Object)]
Expand Down
5 changes: 0 additions & 5 deletions bindings/matrix-sdk-ffi/src/timeline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,6 @@ pub struct SetData {
pub item: Arc<TimelineItem>,
}

pub struct MoveData {
pub old_index: u32,
pub new_index: u32,
}

#[derive(Clone, Copy, uniffi::Enum)]
pub enum TimelineChange {
Append,
Expand Down

0 comments on commit 53ae436

Please sign in to comment.