fix(docs): correct panic message in copied example code (#3911)

This commit is contained in:
LeoniePhiline
2025-05-02 14:14:36 +02:00
committed by GitHub
parent 9b2e313d20
commit e5b21ac0fc

View File

@@ -237,10 +237,10 @@ pub fn provide_context<T: Send + Sync + 'static>(value: T) {
/// Effect::new(move |_| {
/// // each use_context clones the value
/// let value =
/// use_context::<String>().expect("could not find i32 in context");
/// use_context::<String>().expect("could not find String in context");
/// assert_eq!(value, "foo");
/// let value2 =
/// use_context::<String>().expect("could not find i32 in context");
/// use_context::<String>().expect("could not find String in context");
/// assert_eq!(value2, "foo");
/// });
/// });
@@ -285,10 +285,10 @@ pub fn use_context<T: Clone + 'static>() -> Option<T> {
/// Effect::new(move |_| {
/// // each use_context clones the value
/// let value =
/// use_context::<String>().expect("could not find i32 in context");
/// use_context::<String>().expect("could not find String in context");
/// assert_eq!(value, "foo");
/// let value2 =
/// use_context::<String>().expect("could not find i32 in context");
/// use_context::<String>().expect("could not find String in context");
/// assert_eq!(value2, "foo");
/// });
/// });