Skip to content

Commit

Permalink
feat(ingestion_node): add constructor with defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
timonv committed Jun 23, 2024
1 parent 9004323 commit 15deeb7
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions swiftide/src/ingestion/ingestion_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ pub struct IngestionNode {
}

impl IngestionNode {
/// Creates a new instance of `IngestionNode` with the specified data chunk.
///
/// The other fields are set to their default values.
pub fn new(chunk: impl Into<String>) -> IngestionNode {
IngestionNode {
chunk: chunk.into(),
..Default::default()
}
}

/// Converts the node into an embeddable string format.
///
/// The embeddable format consists of the metadata formatted as key-value pairs, each on a new line,
Expand Down

0 comments on commit 15deeb7

Please sign in to comment.