Page MenuHomePhabricator

[services] Backup - Blob Get Client - Pass rust string instead of const char*
ClosedPublic

Authored by karol on Sep 9 2022, 7:07 AM.
Tags
None
Referenced Files
F3365801: D5099.id16617.diff
Mon, Nov 25, 7:48 AM
F3365732: D5099.id16556.diff
Mon, Nov 25, 7:31 AM
F3364769: D5099.diff
Mon, Nov 25, 5:07 AM
Unknown Object (File)
Fri, Nov 22, 6:53 AM
Unknown Object (File)
Thu, Nov 21, 10:30 PM
Unknown Object (File)
Thu, Nov 14, 5:06 PM
Unknown Object (File)
Sun, Nov 10, 6:57 AM
Unknown Object (File)
Thu, Oct 31, 5:12 AM

Details

Summary

Depends on D5097

Raised in https://phab.comm.dev/D5035#148669

We can construct rust::Strings in c++ instead of passing const char*s from c++ to rust.

Test Plan

Services build, tests pass.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Sep 9 2022, 7:08 AM
Harbormaster failed remote builds in B12055: Diff 16555!

retrigger CI - failed on identity build that's unrelated

tomek requested changes to this revision.Sep 9 2022, 7:30 AM
tomek added inline comments.
services/backup/blob_client/src/lib.rs
17–39 ↗(On Diff #16556)

Are the functions still unsafe? Our guess was that it was caused by a raw pointer.

This revision now requires changes to proceed.Sep 9 2022, 7:30 AM
services/backup/blob_client/src/lib.rs
17–39 ↗(On Diff #16556)

Right, missed that.

jon requested changes to this revision.Sep 12 2022, 9:11 AM
jon added inline comments.
services/backup/blob_client/src/put_client.rs
200 ↗(On Diff #16576)

since we are just passing this to a hashmap, we should be able to use &str. Also avoids all the .clone() usage everywhere as you're no longer taking ownership of the string

This revision now requires changes to proceed.Sep 12 2022, 9:11 AM
services/backup/blob_client/src/put_client.rs
200 ↗(On Diff #16576)

Right, we can refactor some Strings into &strs, will do.

use more &str instead of String

This revision is now accepted and ready to land.Sep 15 2022, 9:02 AM
This revision was landed with ongoing or failed builds.Sep 19 2022, 7:28 AM
This revision was automatically updated to reflect the committed changes.