From 4105f7988b57deb6491547ce4b8c5966b602dbdd Mon Sep 17 00:00:00 2001 From: daxpedda <1645124+daxpedda@users.noreply.github.com> Date: Sat, 1 Dec 2018 12:22:39 +0100 Subject: [PATCH] Fix typo in "wasm_bindgen::JsCast" trait docs This method will return `Err(self)` **is** `self.is_instance_of::<T>()` returns `false` should be This method will return `Err(self)` **if** `self.is_instance_of::<T>()` returns `false` --- src/cast.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cast.rs b/src/cast.rs index f856761b..97b9846e 100644 --- a/src/cast.rs +++ b/src/cast.rs @@ -30,7 +30,7 @@ where /// Performs a dynamic cast (checked at runtime) of this value into the /// target type `T`. /// - /// This method will return `Err(self)` is `self.is_instance_of::<T>()` + /// This method will return `Err(self)` if `self.is_instance_of::<T>()` /// returns `false`, and otherwise it will return `Ok(T)` manufactured with /// an unchecked cast (verified correct via the `instanceof` operation). fn dyn_into<T>(self) -> Result<T, Self> @@ -47,7 +47,7 @@ where /// Performs a dynamic cast (checked at runtime) of this value into the /// target type `T`. /// - /// This method will return `None` is `self.is_instance_of::<T>()` + /// This method will return `None` if `self.is_instance_of::<T>()` /// returns `false`, and otherwise it will return `Some(&T)` manufactured /// with an unchecked cast (verified correct via the `instanceof` operation). fn dyn_ref<T>(&self) -> Option<&T>