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

Solved the Great Response Crisis of Week 8 #30

Merged
merged 6 commits into from
Jun 16, 2014
Merged

Conversation

reem
Copy link
Member

@reem reem commented Jun 16, 2014

By coercing lifetimes instead of types and moving from_http to its own trait, we have
managed to both allow new Response representations and remove all the lifetimes from
everywhere.

Such is the power of Sundays.

@zzmp
Copy link
Member

zzmp commented Jun 16, 2014

Shoutout to @Ogeon - thanks for your help.

@zzmp zzmp closed this Jun 16, 2014
@zzmp zzmp reopened this Jun 16, 2014
zzmp added a commit that referenced this pull request Jun 16, 2014
Solved the Great Response Crisis of Week 8
@zzmp zzmp merged commit 9b18c96 into master Jun 16, 2014
@reem reem deleted the refactor/response-lifetime branch June 16, 2014 04:44
writer: writer
}
)
}
Copy link

Choose a reason for hiding this comment

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

Why are you transmuting this to what it already is? This is a bit risky and it could be avoided by defining the trait as

pub trait HttpResponse<'a, 'b> {
    fn from_http(&'a mut ResponseWriter<'b>) -> Self;
}

Copy link
Member Author

Choose a reason for hiding this comment

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

This was my original approach (you can see the remains on my great-response-crisis branch of my fork, if you're curious) but that doesn't work for the reasons @zzmp discussed with you on #iron last night.

@zzmp
Copy link
Member

zzmp commented Jun 16, 2014

I'm working on this in my fork's bug/lifetime-response branch. It may be a good starting-off point, though it does not compile.

phlmn pushed a commit to phlmn/iron that referenced this pull request Oct 19, 2018
phlmn pushed a commit to phlmn/iron that referenced this pull request Oct 19, 2018
phlmn pushed a commit to phlmn/iron that referenced this pull request Oct 18, 2019
Updates for upstream Iron changes.
Sign up for free to 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.

3 participants