diff --git a/edn/src/symbols.rs b/edn/src/symbols.rs index 34e6d903..9cb105fd 100644 --- a/edn/src/symbols.rs +++ b/edn/src/symbols.rs @@ -64,7 +64,7 @@ pub struct Keyword(pub String); #[derive(Clone,Debug,Eq,Hash,Ord,PartialOrd,PartialEq)] pub struct NamespacedKeyword { - // We derive PartialOrd, which implements a lexicographic based + // We derive PartialOrd, which implements a lexicographic order based // on the order of members, so put namespace first. pub namespace: String, pub name: String, @@ -123,13 +123,16 @@ impl NamespacedKeyword { } } - /// Whether this NamespacedKeyword should be interpreted in reverse order. For example, + /// Whether this `NamespacedKeyword` should be interpreted in reverse order. For example, /// the two following snippets are identical: + /// + /// ```edn /// [?y :person/friend ?x] /// [?x :person/hired ?y] /// /// [?y :person/friend ?x] /// [?y :person/_hired ?x] + /// ``` /// /// # Examples /// @@ -143,7 +146,7 @@ impl NamespacedKeyword { self.name.starts_with("_") } - /// Whether this NamespacedKeyword should be interpreted in forward order. + /// Whether this `NamespacedKeyword` should be interpreted in forward order. /// See `symbols::NamespacedKeyword::is_backwards`. /// /// # Examples @@ -158,8 +161,8 @@ impl NamespacedKeyword { !self.is_backward() } - /// Returns an Option with the same name and namespace, but - /// considered reversed. See `symbols::NamespacedKeyword::is_backward`. + /// Returns a `NamespacedKeyword` with the same namespace and a + /// 'backward' name. See `symbols::NamespacedKeyword::is_backward`. /// /// # Examples /// diff --git a/edn/src/types.rs b/edn/src/types.rs index 33bd998d..dbfad2d2 100644 --- a/edn/src/types.rs +++ b/edn/src/types.rs @@ -33,8 +33,8 @@ pub enum Value { Vector(Vec), List(LinkedList), // We're using BTree{Set, Map} rather than Hash{Set, Map} because the BTree variants - // implement Hash (unlike the Hash variants which don't in order to preserve O(n) hashing - // time which is hard given recurrsive data structures) + // implement Hash. The Hash variants don't in order to preserve O(n) hashing + // time, which is hard given recursive data structures. // See https://internals.rust-lang.org/t/implementing-hash-for-hashset-hashmap/3817/1 Set(BTreeSet), Map(BTreeMap),