Skip to content

Commit

Permalink
docs(core): fix panic section on manage documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasfernog committed Jun 18, 2023
1 parent 8c0166f commit 79b3dca
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
8 changes: 2 additions & 6 deletions core/tauri/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1207,17 +1207,13 @@ impl<R: Runtime> Builder<R> {

/// Add `state` to the state managed by the application.
///
/// This method can be called any number of times as long as each call
/// refers to a different `T`.
/// If the state for the `T` type has previously been set, the state is unchanged and false is returned. Otherwise true is returned.
///
/// Managed state can be retrieved by any command handler via the
/// [`State`](crate::State) guard. In particular, if a value of type `T`
/// is managed by Tauri, adding `State<T>` to the list of arguments in a
/// command handler instructs Tauri to retrieve the managed value.
///
/// # Panics
///
/// Panics if state of type `T` is already being managed.
/// Additionally, [`state`](crate::Manager#method.state) can be used to retrieve the value manually.
///
/// # Mutability
///
Expand Down
9 changes: 2 additions & 7 deletions core/tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -756,18 +756,13 @@ pub trait Manager<R: Runtime>: sealed::ManagerBase<R> {

/// Add `state` to the state managed by the application.
///
/// This method can be called any number of times as long as each call
/// refers to a different `T`.
/// If a state for `T` is already managed, the function returns false and the value is ignored.
/// If the state for the `T` type has previously been set, the state is unchanged and false is returned. Otherwise true is returned.
///
/// Managed state can be retrieved by any command handler via the
/// [`State`](crate::State) guard. In particular, if a value of type `T`
/// is managed by Tauri, adding `State<T>` to the list of arguments in a
/// command handler instructs Tauri to retrieve the managed value.
///
/// # Panics
///
/// Panics if state of type `T` is already being managed.
/// Additionally, [`state`](Self#method.state) can be used to retrieve the value manually.
///
/// # Mutability
///
Expand Down

0 comments on commit 79b3dca

Please sign in to comment.