Fix a few more typos

This commit is contained in:
Dave Hrycyszyn
2024-05-30 15:41:41 +01:00
parent 2f19d0c9cc
commit 0733e12539

View File

@@ -33,7 +33,7 @@ pub trait CrdtNode: CrdtNodeFromValue + Hashable + Clone {
pub enum OpState { pub enum OpState {
/// Operation applied successfully /// Operation applied successfully
Ok, Ok,
/// Tried to apply an operation to a non-CRDT primative (i.e. f64, bool, etc.) /// Tried to apply an operation to a non-CRDT primitive (i.e. f64, bool, etc.)
/// If you would like a mutable primitive, wrap it in a [`LWWRegisterCRDT`] /// If you would like a mutable primitive, wrap it in a [`LWWRegisterCRDT`]
ErrApplyOnPrimitive, ErrApplyOnPrimitive,
/// Tried to apply an operation to a static struct CRDT /// Tried to apply an operation to a static struct CRDT
@@ -45,7 +45,7 @@ pub enum OpState {
/// The signed digest of the message did not match the claimed author of the message. /// The signed digest of the message did not match the claimed author of the message.
/// This can happen if the message was tampered with during delivery /// This can happen if the message was tampered with during delivery
ErrDigestMismatch, ErrDigestMismatch,
/// The hash of the message did not match the contents of the mesage. /// The hash of the message did not match the contents of the message.
/// This can happen if the author tried to perform an equivocation attack by creating an /// This can happen if the author tried to perform an equivocation attack by creating an
/// operation and modifying it has already been created /// operation and modifying it has already been created
ErrHashMismatch, ErrHashMismatch,
@@ -98,8 +98,8 @@ pub struct BaseCrdt<T: CrdtNode> {
/// Internal base CRDT /// Internal base CRDT
pub doc: T, pub doc: T,
/// In a real world scenario, this would be a proper hashgraph that allows for /// In a real world scenario, this would be a proper hash graph that allows for
/// efficient reconciliation of missing dependencies. We naively keep a hashset /// efficient reconciliation of missing dependencies. We naively keep a hash set
/// of messages we've seen (represented by their [`SignedDigest`]). /// of messages we've seen (represented by their [`SignedDigest`]).
received: HashSet<SignedDigest>, received: HashSet<SignedDigest>,
message_q: HashMap<SignedDigest, Vec<SignedOp>>, message_q: HashMap<SignedDigest, Vec<SignedOp>>,
@@ -190,10 +190,10 @@ impl SignedOp {
} }
impl<T: CrdtNode + DebugView> BaseCrdt<T> { impl<T: CrdtNode + DebugView> BaseCrdt<T> {
/// Crease a new BaseCRDT of the given type. Multiple BaseCRDTs /// Create a new BaseCRDT of the given type. Multiple BaseCRDTs
/// can be created from a single keypair but you are responsible for /// can be created from a single keypair but you are responsible for
/// routing messages to the right BaseCRDT. Usually you should just make a single /// routing messages to the right BaseCRDT. Usually you should just make a single
/// struct that contains all the state you need /// struct that contains all the state you need.
pub fn new(keypair: &Ed25519KeyPair) -> Self { pub fn new(keypair: &Ed25519KeyPair) -> Self {
let id = keypair.public().0.to_bytes(); let id = keypair.public().0.to_bytes();
Self { Self {