Use string::data and string_view to clean up some string handling,
as suggested by reviewers.
Signed-off-by: Marcus Watts <mwatts@redhat.com>
static int
kmip_write_an_error_helper(const char *s, size_t l, void *u) {
CephContext *cct = (CephContext *)u;
- std::string es(s, l);
+ std::string_view es(s, l);
lderr(cct) << es << dendl;
return l;
}
{
RGWKMIPTransceiver secret_req(cct, RGWKMIPTransceiver::LOCATE);
- secret_req.name = (char *) work.c_str(); // XXX ugh constness
+ secret_req.name = work.data();
ret = secret_req.process(null_yield);
if (ret < 0) {
failed = true;
{
if (failed) return ret;
RGWKMIPTransceiver secret_req(cct, RGWKMIPTransceiver::GET);
- secret_req.unique_id = (char *) work.c_str(); // XXX ugh constness.
+ secret_req.unique_id = work.data();
ret = secret_req.process(null_yield);
if (ret < 0) {
failed = true;