Skip to content

Cleanup for std::result - #7969

Closed
MaikKlein wants to merge 8 commits into
rust-lang:masterfrom
MaikKlein:master
Closed

Cleanup for std::result#7969
MaikKlein wants to merge 8 commits into
rust-lang:masterfrom
MaikKlein:master

Conversation

@MaikKlein

Copy link
Copy Markdown
Contributor

I am doing some cleanups in std::result.

@alexcrichton

Copy link
Copy Markdown
Member

It looks like this has also added back in net/ip and net/tcp, would you mind amending to remove those?

@MaikKlein

Copy link
Copy Markdown
ContributorAuthor

Oh that is weird, I thought I deleted them. Thanks for the catch.

Comment threadsrc/libstd/result.rs Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should use the method, not the function.

@MaikKlein

Copy link
Copy Markdown
ContributorAuthor

what is the best way to delete the changes to net::tcp etc in 3043b71?

git checkout 3043b71 , git rm net::tcp , git commit --amend and then back with git checkout master?

@MaikKlein

Copy link
Copy Markdown
ContributorAuthor

I am sorry, I am not that proficient in git yet. I am currently reading the git book. I was trying for hours to edit my commit and remove the tcp /ip changes but it didn't work out.

So I just added a additional commit, that removes tcp and ip :(

@erickt

Copy link
Copy Markdown
Contributor

@MaikKlein: You can use an interactive rebase to clean up the history. Here are some links on how to do it:

Your case is pretty simple though, since you added the files in one commit back from the HEAD branch. You should be able to squash the two with:

% git branch backup master # just to save your work in case something goes wronge
% git reset --soft HEAD~ # this throws away commit 8662e95, but leaves the change you made (removing tcp/ip)
% git commit --amend # this adds the changes you made in 8662e95 to 44692ac
% gitk --all& # see if everything changed like you expected
% git branch -D backup # assuming everything looks good
% git push -f $YOUR_REMOTE master

Feel free to ping me on #rust IRC (erickt) if you need some help with this. If I'm not around, I'm sure someone else in the channel could help you out as well.

@alexcrichton

Copy link
Copy Markdown
Member

Whenever this is no longer a work-in-progress, feel free to comment saying so and I'd be willing to take a look!

@MaikKlein

Copy link
Copy Markdown
ContributorAuthor

Thanks, I am sorry for the mess. Next time when I do a PR I will have a proper knowledge of git. I will finish this PR now.

@MaikKlein

Copy link
Copy Markdown
ContributorAuthor

I think the cleanup work is finished. If the PR is in a too messy state to be processed, then I will redo the PR in a few days. For example 58f934f is completely unecessary the commit somehow got merged with 2edf6d2, and the libextra/net removal is in 9593c14 .

I really have to learn some git, I just thought git would be more straight forward.

I just removed the functions in std::result.rs. They are all methods now. I updated the examples. I also added a ToEither trait for the to_either method.

@MaikKlein

Copy link
Copy Markdown
ContributorAuthor

everything compiles and all tests pass now

@erickt

Copy link
Copy Markdown
Contributor

@MaikKlein: Just in case you didn't notice, there were some errors with the merge.

@MaikKlein

Copy link
Copy Markdown
ContributorAuthor

Yes I have noticed it. It seems that I have messed something up. I just have no working station at the moment, I hope that I can fix it tomorrow.

@erickterickt mentioned this pull request Jul 27, 2013
bors added a commit that referenced this pull request Jul 28, 2013
Good evening,
This is a superset of @MaikKlein's #7969 commit, that I've fixed up to compile. I had a couple commits I wanted to do on top of @MaikKlein's work that I didn't want to bitrot.
@huonw

Copy link
Copy Markdown
Contributor

Landed in #8069.

@huonwhuonw closed this Jul 28, 2013
flip1995 pushed a commit to flip1995/rust that referenced this pull request Nov 23, 2021
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
7969: Return original text range in PrepareRename responses when inside macro r=Veykril a=Veykril
bors r+
Issue found in rust-lang#7968
Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@MaikKlein@alexcrichton@erickt@huonw@bors