mirror of
https://github.com/OMGeeky/google-apis-rs.git
synced 2026-01-25 04:35:18 +01:00
refactor(CLI): better vector building
Instead of using multiple lines to add vectors up involving iterators, I just add slices together. This should produce less, and possibly faster machine code, with less ascii code. Downloads tested with drive2, and are verified to be working ! Close #97
This commit is contained in:
@@ -82,10 +82,13 @@ def new_method_context(resource, method, c):
|
||||
return MethodContext(m, response_schema, params, request_value, media_params,
|
||||
required_props, optional_props, part_prop)
|
||||
|
||||
def comma_sep_fields(fields):
|
||||
return ', '.join('"%s"' % mangle_subcommand(f) for f in fields)
|
||||
|
||||
# Returns a string representing a string-vector of mangled names
|
||||
# fields is an iterator
|
||||
def field_vec(fields):
|
||||
return "vec![%s]" % ', '.join('"%s"' % mangle_subcommand(f) for f in fields)
|
||||
return "vec![%s]" % comma_sep_fields(fields)
|
||||
|
||||
def pretty(n):
|
||||
return ' '.join(s.capitalize() for s in mangle_subcommand(n).split('-'))
|
||||
|
||||
Reference in New Issue
Block a user