Skip to content

Minor type nits in string arguments example #72

Open
@noncombatant

Description

@noncombatant

Re: http://jakegoulding.com/rust-ffi-omnibus/string_arguments/

Rust count returns usize; rather than (potentially down-)casting to uint32_t, does it make sense to change the example to return size_t? And then you don't need a cast.

In the C code, the printf format should be %u, or %zu if you use size_t. (Also you'll want to use %u in /slice_arguments/, and in /tuples. Or use int32_t, for which %d is appropriate.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions