radicle-dev / radicle-surf

A code browsing library for VCS file systems.
Other
32 stars 11 forks source link

Survey surf #69

Open FintanH opened 4 years ago

FintanH commented 4 years ago

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 commented 4 years ago

Naming

Interop

Documentation

Flexibility

kim commented 4 years ago

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

FintanH commented 4 years ago

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

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

cloudhead commented 4 years ago

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 commented 4 years ago

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: