chore: replace try_from with from

This commit is contained in:
appflowy
2022-07-19 11:31:04 +08:00
parent 2981b685bc
commit e7c672cb7e
13 changed files with 97 additions and 117 deletions

View File

@ -17,7 +17,7 @@ use flowy_folder::{errors::ErrorCode, services::folder_editor::FolderEditor};
use flowy_revision::disk::RevisionState;
use flowy_revision::REVISION_WRITE_INTERVAL_IN_MILLIS;
use flowy_sync::entities::text_block::TextBlockInfoPB;
use flowy_sync::entities::text_block::DocumentPB;
use flowy_test::{event_builder::*, FlowySDKTest};
use std::{sync::Arc, time::Duration};
use tokio::time::sleep;
@ -399,14 +399,14 @@ pub async fn delete_view(sdk: &FlowySDKTest, view_ids: Vec<String>) {
}
#[allow(dead_code)]
pub async fn set_latest_view(sdk: &FlowySDKTest, view_id: &str) -> TextBlockInfoPB {
pub async fn set_latest_view(sdk: &FlowySDKTest, view_id: &str) -> DocumentPB {
let view_id: ViewId = view_id.into();
FolderEventBuilder::new(sdk.clone())
.event(SetLatestView)
.payload(view_id)
.async_send()
.await
.parse::<TextBlockInfoPB>()
.parse::<DocumentPB>()
}
pub async fn read_trash(sdk: &FlowySDKTest) -> RepeatedTrash {