aboutsummaryrefslogtreecommitdiffstats
path: root/src/access/policy.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/access/policy.rs')
-rw-r--r--src/access/policy.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/access/policy.rs b/src/access/policy.rs
index e4027b8..e596175 100644
--- a/src/access/policy.rs
+++ b/src/access/policy.rs
@@ -119,7 +119,7 @@ pub(crate) fn as_written(value: &JsonValue) -> Result<Policy, String> {
/// where its `store` is, as continuum writes them: an Automerge text there, or one holding
/// the policy, reads as a string in plain JSON, so a policy that would read so only
/// through a text is one nobody knows, never what its characters spell.
-pub(crate) fn of(doc: &impl Read) -> Policy {
+pub(crate) fn of(doc: &(impl Read + ?Sized)) -> Policy {
match view::read_plain(doc, &path()) {
Ok(Some(value)) => match read(&value) {
policy if policy.strict() && !a_string(doc, "values") => {
@@ -138,7 +138,7 @@ pub(crate) fn of(doc: &impl Read) -> Policy {
/// Whether the policy `doc` holds, read in typed JSON (where a text is tagged, and an
/// envelope reads as its payload), has a string for its `key`.
-fn a_string(doc: &impl Read, key: &str) -> bool {
+fn a_string(doc: &(impl Read + ?Sized), key: &str) -> bool {
matches!(
doc.read_typed(&path()),
Ok(Some(value)) if value.get(key).is_some_and(JsonValue::is_string)