feat: 收口 Rust Web 3000 主链
This commit is contained in:
@@ -57,12 +57,12 @@ pub async fn local_folder_events(
|
||||
let stream = stream::unfold(
|
||||
(Some(initial), subscription, document_relative_path),
|
||||
|(initial, mut subscription, document_relative_path)| async move {
|
||||
if let Some(payload) = initial {
|
||||
return Some((
|
||||
Ok(stream_event("ready", &payload)),
|
||||
(None, subscription, document_relative_path),
|
||||
));
|
||||
}
|
||||
if let Some(payload) = initial {
|
||||
return Some((
|
||||
Ok(stream_event("ready", &payload)),
|
||||
(None, subscription, document_relative_path),
|
||||
));
|
||||
}
|
||||
loop {
|
||||
match subscription.receiver.recv().await {
|
||||
Ok(payload) => {
|
||||
@@ -152,8 +152,7 @@ mod tests {
|
||||
#[test]
|
||||
fn local_markdown_document_id_maps_to_relative_path() {
|
||||
assert_eq!(
|
||||
local_markdown_relative_path_from_document_id("local-md:docs~2FREADME.md")
|
||||
.as_deref(),
|
||||
local_markdown_relative_path_from_document_id("local-md:docs~2FREADME.md").as_deref(),
|
||||
Some("docs/README.md")
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user