Add space between rsx and exclamation point (#2956)
This commit is contained in:
1 parent
8d68886310
commit
c7124e41fb
20 files changed
+41
-41
No files matched your search
@@ -106,7 +106,7 @@ pub trait Context<T, E>: private::Sealed {
|
||||
/// "Error parsing number: {error}"
|
||||
/// }
|
||||
/// })?;
|
||||
/// todo!()
|
||||
/// unimplemented!()
|
||||
/// }
|
||||
/// ```
|
||||
fn show(self, display_error: impl FnOnce(&E) -> Element) -> Result<T>;
|
||||
@@ -120,7 +120,7 @@ pub trait Context<T, E>: private::Sealed {
|
||||
/// // You can bubble up errors with `?` inside components, and event handlers
|
||||
/// // Along with the error itself, you can provide a way to display the error by calling `context`
|
||||
/// let number = "-1234".parse::<usize>().context("Parsing number inside of the NumberParser")?;
|
||||
/// todo!()
|
||||
/// unimplemented!()
|
||||
/// }
|
||||
/// ```
|
||||
fn context<C: Display + 'static>(self, context: C) -> Result<T>;
|
||||
@@ -134,7 +134,7 @@ pub trait Context<T, E>: private::Sealed {
|
||||
/// // You can bubble up errors with `?` inside components, and event handlers
|
||||
/// // Along with the error itself, you can provide a way to display the error by calling `context`
|
||||
/// let number = "-1234".parse::<usize>().with_context(|| format!("Timestamp: {:?}", std::time::Instant::now()))?;
|
||||
/// todo!()
|
||||
/// unimplemented!()
|
||||
/// }
|
||||
/// ```
|
||||
fn with_context<C: Display + 'static>(self, context: impl FnOnce() -> C) -> Result<T>;
|
||||
|
||||
@@ -201,7 +201,7 @@ impl<T: std::fmt::Debug> std::fmt::Debug for Event<T> {
|
||||
///
|
||||
/// ```rust, no_run
|
||||
/// # use dioxus::prelude::*;
|
||||
/// rsx!{
|
||||
/// rsx! {
|
||||
/// MyComponent { onclick: move |evt| tracing::debug!("clicked") }
|
||||
/// };
|
||||
///
|
||||
@@ -211,7 +211,7 @@ impl<T: std::fmt::Debug> std::fmt::Debug for Event<T> {
|
||||
/// }
|
||||
///
|
||||
/// fn MyComponent(cx: MyProps) -> Element {
|
||||
/// rsx!{
|
||||
/// rsx! {
|
||||
/// button {
|
||||
/// onclick: move |evt| cx.onclick.call(evt),
|
||||
/// }
|
||||
@@ -228,7 +228,7 @@ pub type EventHandler<T = ()> = Callback<T>;
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust, ignore
|
||||
/// rsx!{
|
||||
/// rsx! {
|
||||
/// MyComponent { onclick: move |evt| {
|
||||
/// tracing::debug!("clicked");
|
||||
/// 42
|
||||
@@ -241,7 +241,7 @@ pub type EventHandler<T = ()> = Callback<T>;
|
||||
/// }
|
||||
///
|
||||
/// fn MyComponent(cx: MyProps) -> Element {
|
||||
/// rsx!{
|
||||
/// rsx! {
|
||||
/// button {
|
||||
/// onclick: move |evt| println!("number: {}", cx.onclick.call(evt)),
|
||||
/// }
|
||||
@@ -256,7 +256,7 @@ pub struct Callback<Args = (), Ret = ()> {
|
||||
/// # use dioxus::prelude::*;
|
||||
/// #[component]
|
||||
/// fn Child(onclick: EventHandler<MouseEvent>) -> Element {
|
||||
/// rsx!{
|
||||
/// rsx! {
|
||||
/// button {
|
||||
/// // Diffing Child will not rerun this component, it will just update the callback in place so that if this callback is called, it will run the latest version of the callback
|
||||
/// onclick: move |evt| onclick(evt),
|
||||
|
||||
@@ -14,7 +14,7 @@ use crate::innerlude::*;
|
||||
/// ```rust
|
||||
/// # use dioxus::prelude::*;
|
||||
/// let value = 1;
|
||||
/// rsx!{
|
||||
/// rsx! {
|
||||
/// Fragment { key: "{value}" }
|
||||
/// };
|
||||
/// ```
|
||||
@@ -76,7 +76,7 @@ impl<const A: bool> FragmentBuilder<A> {
|
||||
///
|
||||
/// #[component]
|
||||
/// fn CustomCard(children: Element) -> Element {
|
||||
/// rsx!{
|
||||
/// rsx! {
|
||||
/// div {
|
||||
/// h1 {"Title card"}
|
||||
/// {children}
|
||||
|
||||
@@ -25,13 +25,13 @@ pub fn vdom_is_rendering() -> bool {
|
||||
/// fn Component() -> Element {
|
||||
/// let request = spawn(async move {
|
||||
/// match reqwest::get("https://api.example.com").await {
|
||||
/// Ok(_) => todo!(),
|
||||
/// Ok(_) => unimplemented!(),
|
||||
/// // You can explicitly throw an error into a scope with throw_error
|
||||
/// Err(err) => ScopeId::APP.throw_error(err)
|
||||
/// }
|
||||
/// });
|
||||
///
|
||||
/// todo!()
|
||||
/// unimplemented!()
|
||||
/// }
|
||||
/// ```
|
||||
pub fn throw_error(error: impl Into<CapturedError> + 'static) {
|
||||
@@ -351,7 +351,7 @@ pub fn schedule_update_any() -> Arc<dyn Fn(ScopeId) + Send + Sync> {
|
||||
/// window.scroll_with_x_and_y(original_scroll_position(), 0.0);
|
||||
/// });
|
||||
///
|
||||
/// rsx!{
|
||||
/// rsx! {
|
||||
/// div {
|
||||
/// id: "my_element",
|
||||
/// "hello"
|
||||
|
||||
@@ -435,7 +435,7 @@ impl Runtime {
|
||||
/// }
|
||||
///
|
||||
/// fn app() -> Element {
|
||||
/// rsx!{ Component { runtime: Runtime::current().unwrap() } }
|
||||
/// rsx! { Component { runtime: Runtime::current().unwrap() } }
|
||||
/// }
|
||||
///
|
||||
/// // In a dynamic library
|
||||
|
||||
@@ -558,13 +558,13 @@ impl ScopeId {
|
||||
/// fn Component() -> Element {
|
||||
/// let request = spawn(async move {
|
||||
/// match reqwest::get("https://api.example.com").await {
|
||||
/// Ok(_) => todo!(),
|
||||
/// Ok(_) => unimplemented!(),
|
||||
/// // You can explicitly throw an error into a scope with throw_error
|
||||
/// Err(err) => ScopeId::APP.throw_error(err)
|
||||
/// }
|
||||
/// });
|
||||
///
|
||||
/// todo!()
|
||||
/// unimplemented!()
|
||||
/// }
|
||||
/// ```
|
||||
pub fn throw_error(self, error: impl Into<CapturedError> + 'static) {
|
||||
|
||||
@@ -269,7 +269,7 @@ impl VirtualDom {
|
||||
/// }
|
||||
///
|
||||
/// fn Example(cx: SomeProps) -> Element {
|
||||
/// rsx!{ div { "hello {cx.name}" } }
|
||||
/// rsx! { div { "hello {cx.name}" } }
|
||||
/// }
|
||||
///
|
||||
/// let dom = VirtualDom::new_with_props(Example, SomeProps { name: "world" });
|
||||
@@ -285,7 +285,7 @@ impl VirtualDom {
|
||||
/// # name: &'static str
|
||||
/// # }
|
||||
/// # fn Example(cx: SomeProps) -> Element {
|
||||
/// # rsx!{ div { "hello {cx.name}" } }
|
||||
/// # rsx! { div { "hello {cx.name}" } }
|
||||
/// # }
|
||||
/// let mut dom = VirtualDom::new_with_props(Example, SomeProps { name: "jane" });
|
||||
/// dom.rebuild_in_place();
|
||||
|
||||
Reference in new issue
Block a user