These are chat archives for rust-lang/rust

29th
Apr 2019
Kelly Thomas Kline
@kellytk
Apr 29 01:27
Where can I find privacy docs on what data cargo sends?
Ingvar Stepanyan
@RReverser
Apr 29 17:04
@kellytk Basically, you can't right now: rust-lang/crates.io#955
Ichoran
@Ichoran
Apr 29 17:12
Well, you kinda can, presumably, by reading that thread.
(But the docs aren't official, obviously.)
Ingvar Stepanyan
@RReverser
Apr 29 17:19
Well yeah, I assume that this question is asked for legal purposes, in which case the answer is "you can't".
Ichoran
@Ichoran
Apr 29 17:34
Sometimes people are just curious! I am curious. But yeah, probably the safer assumption that the legal document is needed.
Kelly Thomas Kline
@kellytk
Apr 29 18:23
I found that thread. I also tried to skim the cargo source but it's a bit beyond me to ascertain what data is collected/sent when running cargo build. Specifically I'd like to know if the package's name or other fields in Cargo.toml are sent because I'm working on a client project and would need to use a codename if the name field is uploaded
For such an otherwise well-run project I'm surprised that this info isn't readily available
Sam Johnson
@sam0x17
Apr 29 18:53
I have a method that returns a &[u8] slice. Unfortunately because of the splicing I need to do in the method, I end up having to instantiate a Vec<u8> to put together the data that goes in the slice, and I am getting the returns a value referencing data owned by the current function error. What is the general workaround for this?
Denis Lisov
@tanriol
Apr 29 18:55
The general workaround is not to return &[u8] unless you're sure all implementations are okay with that.
Ichoran
@Ichoran
Apr 29 21:00
@sam0x17 - In general, slices (and other references) assume that someone else is handling the management of the resource. "I am handling the creation and I want you to handle the disposal" isn't compatible with a slice (or a reference in general).
In particular, -> &[u8] doesn't allow you to smoosh together things to create a new bunch of bytes where there was none before.