Skip to content

SampleBuilder should accept TryFromKeyexpr #2172

@milyin

Description

@milyin

The SampleBuilder::put and SampleBuilder::delete accepts IntoKeyexpr which is inconvenient as it can't accept the &str. E.g. this code is not possible:

let sample = SampleBuilder::put("foo/bar", "payload").into();

and instead user should write

let sample = SampleBuilder::put(KeyExpr::try_from("foo/bar").unwrap(), "payload").into();

There are already multiple SampleBuilder constructors which panics if parameter is wrong. It makes sense to make the put and delete constructors behave the same way: accept TryIntoKeyexpr and panic if keyexpr is incorrect.

The change is not breaking: it just extends possible variants of parameter types, existing code should not be affected

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions