Skip to content

Commit bd32a47

Browse files
committed
fix doc comments
Signed-off-by: Michael X. Grey <greyxmike@gmail.com>
1 parent de6596d commit bd32a47

File tree

3 files changed

+34
-36
lines changed

3 files changed

+34
-36
lines changed

src/buffer/json_buffer.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,6 @@ pub struct JsonBufferKey {
146146

147147
impl JsonBufferKey {
148148
/// Downcast this into a concrete [`BufferKey`] for the specified message type.
149-
///
150-
/// To downcast into a specialized kind of buffer key, use [`Self::downcast_buffer_key`] instead.
151149
pub fn downcast_for_message<T: 'static>(&self) -> Option<BufferKey<T>> {
152150
if TypeId::of::<T>() == self.interface.any_access_interface().message_type_id() {
153151
Some(BufferKey {
@@ -420,7 +418,7 @@ impl<'w, 's, 'a> JsonBufferMut<'w, 's, 'a> {
420418
self.storage.json_push_as_oldest(self.session, message)
421419
}
422420

423-
/// Same as [`Self:push_as_oldest`] but no serialization step is needed for
421+
/// Same as [`Self::push_as_oldest`] but no serialization step is needed for
424422
/// the incoming message.
425423
pub fn push_json_as_oldest(
426424
&mut self,

src/diagram.rs

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -375,37 +375,7 @@ pub struct Diagram {
375375
}
376376

377377
impl Diagram {
378-
/// Spawns a workflow from this diagram.
379-
///
380-
/// # Examples
381-
///
382-
/// ```
383-
/// use bevy_impulse::{Diagram, DiagramError, NodeBuilderOptions, DiagramElementRegistry, RunCommandsOnWorldExt};
384-
///
385-
/// let mut app = bevy_app::App::new();
386-
/// let mut registry = DiagramElementRegistry::new();
387-
/// registry.register_node_builder(NodeBuilderOptions::new("echo".to_string()), |builder, _config: ()| {
388-
/// builder.create_map_block(|msg: String| msg)
389-
/// });
390-
///
391-
/// let json_str = r#"
392-
/// {
393-
/// "version": "0.1.0",
394-
/// "start": "echo",
395-
/// "ops": {
396-
/// "echo": {
397-
/// "type": "node",
398-
/// "builder": "echo",
399-
/// "next": { "builtin": "terminate" }
400-
/// }
401-
/// }
402-
/// }
403-
/// "#;
404-
///
405-
/// let diagram = Diagram::from_json_str(json_str)?;
406-
/// let workflow = app.world.command(|cmds| diagram.spawn_io_workflow(cmds, &registry))?;
407-
/// # Ok::<_, DiagramError>(())
408-
/// ```
378+
/// Implementation for [Self::spawn_io_workflow].
409379
// TODO(koonpeng): Support streams other than `()` #43.
410380
/* pub */
411381
fn spawn_workflow<Streams>(
@@ -447,7 +417,37 @@ impl Diagram {
447417
Ok(w)
448418
}
449419

450-
/// Wrapper to [spawn_workflow::<()>](Self::spawn_workflow).
420+
/// Spawns a workflow from this diagram.
421+
///
422+
/// # Examples
423+
///
424+
/// ```
425+
/// use bevy_impulse::{Diagram, DiagramError, NodeBuilderOptions, DiagramElementRegistry, RunCommandsOnWorldExt};
426+
///
427+
/// let mut app = bevy_app::App::new();
428+
/// let mut registry = DiagramElementRegistry::new();
429+
/// registry.register_node_builder(NodeBuilderOptions::new("echo".to_string()), |builder, _config: ()| {
430+
/// builder.create_map_block(|msg: String| msg)
431+
/// });
432+
///
433+
/// let json_str = r#"
434+
/// {
435+
/// "version": "0.1.0",
436+
/// "start": "echo",
437+
/// "ops": {
438+
/// "echo": {
439+
/// "type": "node",
440+
/// "builder": "echo",
441+
/// "next": { "builtin": "terminate" }
442+
/// }
443+
/// }
444+
/// }
445+
/// "#;
446+
///
447+
/// let diagram = Diagram::from_json_str(json_str)?;
448+
/// let workflow = app.world.command(|cmds| diagram.spawn_io_workflow(cmds, &registry))?;
449+
/// # Ok::<_, DiagramError>(())
450+
/// ```
451451
pub fn spawn_io_workflow(
452452
&self,
453453
cmds: &mut Commands,

src/diagram/registration.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ impl DiagramElementRegistry {
985985
/// Register a node builder with all the common operations (deserialize the
986986
/// request, serialize the response, and clone the response) enabled.
987987
///
988-
/// You will receive a [`RegistrationBuilder`] which you can then use to
988+
/// You will receive a [`NodeRegistrationBuilder`] which you can then use to
989989
/// enable more operations around your node, such as fork result, split,
990990
/// or unzip. The data types of your node need to be suitable for those
991991
/// operations or else the compiler will not allow you to enable them.

0 commit comments

Comments
 (0)