Open FintanH opened 4 years ago
Naming
Interop
git2
does not implement Send
or Sync
so what can we do here. - Relevant ticket: #75Documentation
Flexibility
- Survey ownership in functions https://rust-lang.github.io/api-guidelines/flexibility.html#caller-decides-where-to-copy-and-place-data-c-caller-control
I hate that this is the opposite of what I thought was sensible.
I hate that this is the opposite of what I thought was sensible.
I suppose it makes sense if you want to avoid clone
s :thinking: Like, if you pass in a reference you would hope that it's just the reference being used, but if the function takes owned data then you have to do the clone yourself and you know it's happening, rather than guessing.
Edit: Not avoid clones, but make them explicit
Edit: Not avoid clones, but make them explicit
Actually you do avoid clones in some cases when you can move. Imagine eg. where Self::func
wants ownership:
let foo = Foo::new();
self.func(foo);
// I no longer need `foo` here, so I'm ok with `func` taking ownership. No cloning.
If func
took a reference instead, it would need to clone foo
.
Actually you do avoid clones in some cases when you can move. Imagine eg. where Self::func wants ownership:
Sure, I meant in the case of you having &Foo
and cloning in the function. You force the caller to decide if they're done owning by not calling clone
(your case), or if they aren't then they have to clone
:) I think we all agree :smile:
There is a useful Rust API checklist. It would be great to see what applies to
radicle-surf
and list out the tasks that we could tackle on the checklist.I'd expect the output of this issue an issue that contains a checklist of the things to implement. Each item on the checklist could be a new issue once someone is willing to tackle it.
This could be a great source for contributions :)