Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: fix docs and bad namings in API #2620

Merged
merged 3 commits into from
Jan 15, 2025
Merged

Conversation

grumbach
Copy link
Member

No description provided.

@@ -22,7 +22,7 @@ pub struct GraphEntry {
pub owner: PublicKey,
pub parents: Vec<PublicKey>,
pub content: GraphContent,
pub outputs: Option<Vec<(PublicKey, GraphContent)>>,
pub outputs: Vec<(PublicKey, GraphContent)>,
/// signs the above 4 fields with the owners key
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason for option here is that some patterns we do not have outputs, only Parent. i.e. when used as a file change history the GraphEntry can only go backwards. So the content is a direct or whatever and changes with each entry. There are no outputs in that pattern though.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

An empty vec can be considered as a pattern. But an Option makes it more obvious, though might be a little more complex handling in code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Empty vec indeed sounds like the right balance between usability and simplicity, what do you think?

Copy link
Member

@dirvine dirvine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice @grumbach The docs were old so good to see those changes there too. I left a couple of comments on the GraphEntry type outputs. Looks good to me apart from those comments though

@grumbach grumbach enabled auto-merge January 14, 2025 17:49
@grumbach grumbach added this pull request to the merge queue Jan 15, 2025
Merged via the queue into maidsafe:main with commit 2456e5e Jan 15, 2025
26 checks passed
@grumbach grumbach deleted the fix_docs branch January 15, 2025 11:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants