Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Survey surf #69

Open
FintanH opened this issue Mar 3, 2020 · 5 comments
Open

Survey surf #69

FintanH opened this issue Mar 3, 2020 · 5 comments
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed

Comments

@FintanH
Copy link
Collaborator

FintanH commented Mar 3, 2020

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 :)

@FintanH FintanH added documentation Improvements or additions to documentation help wanted Extra attention is needed labels Mar 3, 2020
@kim
Copy link
Contributor

kim commented Mar 12, 2020 via email

@FintanH
Copy link
Collaborator Author

FintanH commented Mar 12, 2020

I hate that this is the opposite of what I thought was sensible.

I suppose it makes sense if you want to avoid clones 🤔 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

@cloudhead
Copy link
Contributor

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.

@FintanH
Copy link
Collaborator Author

FintanH commented Mar 13, 2020

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 😄

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
documentation Improvements or additions to documentation help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants