Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

`Auth` polishing #43

Merged
merged 3 commits into from May 8, 2019

Conversation

Projects
None yet
3 participants
@dpc
Copy link
Collaborator

commented May 6, 2019

No description provided.

dpc added some commits May 6, 2019

Get rid of lifetime on Auth
If someone needs zero-copy, they will just pass `&Auth`.

And if lifetime is to be used, then user + pass, are two allocations,
so why are they not `&'a str`.

@dpc dpc requested a review from stevenroose May 6, 2019

Show resolved Hide resolved client/src/client.rs Outdated
@stevenroose

This comment has been minimized.

Copy link
Collaborator

commented May 6, 2019

I'm good with the derive. I don't really see why it should be owned. The auth should only be passed into the constructor method and is then not reused.

@sgeisler

This comment has been minimized.

Copy link
Member

commented May 6, 2019

@stevenroose I have no problem with either the owned or the borrowed version, but having this mix of owned and borrowed variants is weird.

@dpc

This comment has been minimized.

Copy link
Collaborator Author

commented May 6, 2019

I don't really see why it should be owned.

In my case, I just pass url + Auth around (already parsed from cmdline/envvars. etc.) and create Client from that when appropriate. https://github.com/dpc/rust-bitcoin-indexer/blob/master/src/prelude.rs#L67

@stevenroose stevenroose added this to the v0.6.0 milestone May 7, 2019

@stevenroose

This comment has been minimized.

Copy link
Collaborator

commented May 7, 2019

Let's wait with merging breaking things (I marked them v0.6.0) in case there are non-breaking things that can go in first (so we don't have to bother with version branches etc).

I'm doing some work using methods I haven't used before and bumping into some minor things meanwhile.

This one can go in like this once we are going for v0.6.0, IMO.

@dpc

This comment has been minimized.

Copy link
Collaborator Author

commented May 7, 2019

I don't understand @stevenroose . :) Anyway, please hit the "merge pull request" button when you think it's OK.

@sgeisler
Copy link
Member

left a comment

LGTM.

@stevenroose stevenroose merged commit 6925ff6 into rust-bitcoin:master May 8, 2019

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dpc dpc deleted the dpc:auth branch May 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.