-
Notifications
You must be signed in to change notification settings - Fork 19
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
Minor fixes to docs and ReconcileError
message
#14
Open
nokome
wants to merge
2
commits into
automerge:main
Choose a base branch
from
nokome:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -193,7 +193,7 @@ pub trait SeqReconciler { | |
/// Delete an index from the sequence | ||
fn delete(&mut self, index: usize) -> Result<(), Self::Error>; | ||
|
||
/// Get the current length of the sequnce | ||
/// Get the current length of the sequence | ||
fn len(&self) -> Result<usize, Self::Error>; | ||
|
||
fn is_empty(&self) -> Result<bool, Self::Error> { | ||
|
@@ -288,7 +288,7 @@ impl<K> LoadKey<K> { | |
/// fn reconcile<R: Reconciler>(&self, mut reconciler: R) -> Result<(), R::Error> { | ||
/// let mut m = reconciler.map()?; | ||
/// m.put("id", &self.id)?; | ||
/// m.put("name", &self.id)?; | ||
/// m.put("name", &self.name)?; | ||
/// Ok(()) | ||
/// } | ||
/// | ||
|
@@ -317,15 +317,15 @@ pub trait Reconcile { | |
|
||
/// Reconcile this item with the document | ||
/// | ||
/// See the documentation of `reconciler` for more details. Typically though there are two | ||
/// See the documentation of [`Reconciler`] for more details. Typically though there are two | ||
/// cases: | ||
/// | ||
/// 1. `R` reconciles to a primitive value, in which case you directly call one of the | ||
/// primitive value methods on [`Reconciler`] (e.g. [`Reconciler::str`] | ||
/// 2. `R` reconciles to a composite data structure - either a map, list, counter, or text in | ||
/// which case you obtain the nested reconciler using [`Reconciler::map`], | ||
/// [`Reconciler::seq`], [`Reconciler::counter`] or [`Reconciler::text`] respectively and | ||
/// then proceed with reconciliation using then ested reconciler | ||
/// then proceed with reconciliation using then nested reconciler | ||
fn reconcile<R: Reconciler>(&self, reconciler: R) -> Result<(), R::Error>; | ||
|
||
/// Hydrate the key for this Object | ||
|
@@ -395,7 +395,7 @@ pub trait Reconcile { | |
pub enum ReconcileError { | ||
#[error(transparent)] | ||
Automerge(#[from] automerge::AutomergeError), | ||
#[error("the top level object must reconile to a map")] | ||
#[error("the top level object must reconcile to a map")] | ||
TopLevelNotMap, | ||
#[error(transparent)] | ||
StaleHeads(#[from] StaleHeads), | ||
|
@@ -864,7 +864,7 @@ impl<'a, D: Doc> TextReconciler for InText<'a, D> { | |
/// Reconcile `value` with `doc` | ||
/// | ||
/// This will throw an error if the implementation of `Reconcile` for `R` does anything except call | ||
/// `Reconciler::map` because only a map is a valid object for the root of an automerge document. | ||
/// `Reconciler::map` because only a map is a valid object for the root of an `automerge` document. | ||
pub fn reconcile<R: Reconcile, D: Doc>(doc: &mut D, value: R) -> Result<(), ReconcileError> { | ||
let reconciler = RootReconciler { | ||
heads: doc.get_heads(), | ||
|
@@ -876,7 +876,7 @@ pub fn reconcile<R: Reconcile, D: Doc>(doc: &mut D, value: R) -> Result<(), Reco | |
|
||
/// Reconcile `value` with `(obj, prop)` in `doc` | ||
/// | ||
/// Sometimes you want to update a particular object within an automerge document | ||
/// This is useful when you want to update a particular object within an `automerge` document e.g. | ||
/// | ||
/// ```rust | ||
/// # use automerge::{ObjType, transaction::Transactable}; | ||
|
@@ -915,7 +915,7 @@ pub fn reconcile_prop<'a, D: Doc, R: Reconcile, O: AsRef<automerge::ObjId>, P: I | |
/// Reconcile into a new index in a sequence | ||
/// | ||
/// This is useful when you specifically want to insert an object which does not implement | ||
/// `Reconcile::key` into a sequence | ||
/// `Reconcile::key` into a sequence. | ||
pub fn reconcile_insert<R: Reconcile>( | ||
doc: &mut automerge::AutoCommit, | ||
obj: automerge::ObjId, | ||
|
@@ -936,7 +936,7 @@ pub fn reconcile_insert<R: Reconcile>( | |
/// Hydrate the key `inner` from inside the object `outer` | ||
/// | ||
/// This is useful when you are attempting to hydrate the key of an object. Imagine you have a | ||
/// structure like this | ||
/// structure like this, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. |
||
/// | ||
/// ```json | ||
/// { | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should end with a colon instead of a comma.