fix most typos, add crate-ci/typos to CI (#2653)
* fix most typos, add crate-ci/typos to CI --------- Co-authored-by: Jonathan Kelley <jkelleyrtp@gmail.com>
This commit is contained in:
1 parent
841b447d2a
commit
9167cd9dec
83 files changed
+258
-203
No files matched your search
@@ -92,25 +92,25 @@ impl VirtualDom {
|
||||
}
|
||||
|
||||
impl ElementPath {
|
||||
pub(crate) fn is_decendant(&self, small: &[u8]) -> bool {
|
||||
pub(crate) fn is_descendant(&self, small: &[u8]) -> bool {
|
||||
small.len() <= self.path.len() && small == &self.path[..small.len()]
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn is_decendant() {
|
||||
fn is_descendant() {
|
||||
let event_path = ElementPath {
|
||||
path: &[1, 2, 3, 4, 5],
|
||||
};
|
||||
|
||||
assert!(event_path.is_decendant(&[1, 2, 3, 4, 5]));
|
||||
assert!(event_path.is_decendant(&[1, 2, 3, 4]));
|
||||
assert!(event_path.is_decendant(&[1, 2, 3]));
|
||||
assert!(event_path.is_decendant(&[1, 2]));
|
||||
assert!(event_path.is_decendant(&[1]));
|
||||
assert!(event_path.is_descendant(&[1, 2, 3, 4, 5]));
|
||||
assert!(event_path.is_descendant(&[1, 2, 3, 4]));
|
||||
assert!(event_path.is_descendant(&[1, 2, 3]));
|
||||
assert!(event_path.is_descendant(&[1, 2]));
|
||||
assert!(event_path.is_descendant(&[1]));
|
||||
|
||||
assert!(!event_path.is_decendant(&[1, 2, 3, 4, 5, 6]));
|
||||
assert!(!event_path.is_decendant(&[2, 3, 4]));
|
||||
assert!(!event_path.is_descendant(&[1, 2, 3, 4, 5, 6]));
|
||||
assert!(!event_path.is_descendant(&[2, 3, 4]));
|
||||
}
|
||||
|
||||
impl PartialEq<&[u8]> for ElementPath {
|
||||
|
||||
Reference in new issue
Block a user