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
F3341076: D5099.diff
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
Unknown Object (File)
Tue, Oct 29, 9:42 PM
Unknown Object (File)
Sun, Oct 27, 8:14 PM
Unknown Object (File)
Sun, Oct 27, 8:14 PM
Unknown Object (File)
Sun, Oct 27, 8:14 PM

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
No Lint Coverage
Unit
No Test Coverage

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.