Fix doc links

This commit is contained in:
Tony Garnock-Jones 2021-08-30 11:56:34 +02:00
parent 8d2b5502be
commit 989cc65d1c
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
//! Useful utilities for working with [`AnyValue`][Actor::AnyValue]s.
//! Useful utilities for working with [`AnyValue`]s.
use preserves::value::Embeddable;
use preserves::value::IOValue;
@ -8,13 +8,13 @@ use std::convert::TryInto;
use crate::actor::*;
/// Converts an `AnyValue` to any [`syndicate::value::NestedValue`],
/// Converts an `AnyValue` to any [`crate::value::NestedValue`],
/// signalling an error if any embedded values are found in `v`.
pub fn from_any_value<N: NestedValue<D>, D: Embeddable>(v: &AnyValue) -> Result<N, &'static str> {
v.copy_via(&mut |_| Err("Embedded values cannot be converted")?)
}
/// Converts any [`syndicate::value::NestedValue`] to an `AnyValue`,
/// Converts any [`crate::value::NestedValue`] to an `AnyValue`,
/// signalling an error if any embedded values are found in `v`.
pub fn to_any_value<N: NestedValue<D>, D: Embeddable>(v: &N) -> Result<AnyValue, &'static str> {
v.copy_via(&mut |_| Err("Embedded values cannot be converted")?)