From 11fae8353b94f190fa83848cb9e082b9bf4c47ff Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Thu, 1 Apr 2021 22:07:28 +0800 Subject: [PATCH] Fix docs, OMG, finding this was *hard* Lesson learned: Don't be to much in a rush or you will miss what's rigth in front of your nose --- src/mako/api/lib/lib.mako | 4 ++-- src/mako/api/lib/mbuild.mako | 2 +- src/mako/lib/util.py | 2 ++ 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/mako/api/lib/lib.mako b/src/mako/api/lib/lib.mako index e6d6cf74af..6f5f318df5 100644 --- a/src/mako/api/lib/lib.mako +++ b/src/mako/api/lib/lib.mako @@ -148,7 +148,7 @@ All *structures* are marked with applicable traits to further categorize them an Generally speaking, you can invoke *Activities* like this: ```Rust,ignore -let r = hub.resource().activity(...).${api.terms.action}() +let r = hub.resource().activity(...).${api.terms.action}().await ``` % if fr: @@ -157,7 +157,7 @@ Or specifically ... ```ignore % for an, a in c.sta_map[fr.id].items(): <% category, resource, activity = activity_split(an) %>\ -let r = hub.${mangle_ident(resource)}().${mangle_ident(activity)}(...).${api.terms.action}() +let r = hub.${mangle_ident(resource)}().${mangle_ident(activity)}(...).${api.terms.action}().await % endfor ``` % endif diff --git a/src/mako/api/lib/mbuild.mako b/src/mako/api/lib/mbuild.mako index 260a1d99ab..3b4cd32bfc 100644 --- a/src/mako/api/lib/mbuild.mako +++ b/src/mako/api/lib/mbuild.mako @@ -287,7 +287,7 @@ ${self._setter_fn(resource, method, m, p, part_prop, ThisType, c)}\ # could also just skip the first element, but ... let's be safe if request_value and request_value.id == p.get(TREF): continue - v = rvfrt(p.name, p) + v = rnd_arg_val_for_type(activity_input_type(schemas, p)) # we chose to replace random strings with their meaning, as indicated by the name ! if is_string_value(v): v = '"%s"' % p.name diff --git a/src/mako/lib/util.py b/src/mako/lib/util.py index e84103962b..9aa730e848 100644 --- a/src/mako/lib/util.py +++ b/src/mako/lib/util.py @@ -46,6 +46,8 @@ RUST_TYPE_RND_MAP = {'bool': lambda: str(bool(randint(0, 1))).lower(), 'i32' : lambda: randint(-101, -1), 'i64' : lambda: randint(-101, -1), 'String': lambda: '"%s"' % choice(words), + '&str': lambda: '"%s"' % choice(words), + '&Vec': lambda: '&vec!["%s".into()]' % choice(words), # why a reference to Vec? Because it works. Should be slice, but who knows how typing works here. } TREF = '$ref' IO_RESPONSE = 'response'