Skip to content
This repository was archived by the owner on Jun 8, 2020. It is now read-only.

Conversation

@Adenilson
Copy link
Contributor

No description provided.

src/azure.rs Outdated
Copy link
Member

Choose a reason for hiding this comment

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

I really don't think we should have a method called "hack."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, I agree. How you like to have it named?

Copy link
Member

Choose a reason for hiding this comment

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

Why is it necessary? It's unclear why you need to create a new AzColor where it's used.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Legacy code calls converting the Color to AzColor and vice-versa. I will
try to remove them.

On Mon, Feb 9, 2015 at 12:38 PM, Martin Robinson notifications@github.com
wrote:

In src/azure.rs
#141 (comment):

@@ -261,6 +261,16 @@ impl PartialEq for AzColor {
}
}

+impl AzColor {

  • pub fn new(r: AzFloat, g: AzFloat, b: AzFloat, a: AzFloat) -> AzColor {
  •     AzColor { r: r, g: g, b: b, a: a }
    
  • }
  • pub fn hack(color: AzColor) -> AzColor {

Why is it necessary? It's unclear why you need to create a new AzColor
where it's used.


Reply to this email directly or view it on GitHub
https://github.com/servo/rust-azure/pull/141/files#r24363008.

@Adenilson
Copy link
Contributor Author

Yeah, there is a need to make an explicit copy of a immutable AzColor to pass it to C code. I will rename the function to 'copy' as it better describes it use.

src/azure.rs Outdated
Copy link
Member

Choose a reason for hiding this comment

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

If you derive from Copy do you really need to implement it as well?

Copy link
Member

Choose a reason for hiding this comment

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

Do you need to add Copy since you are simply using clone below?

@mrobinson
Copy link
Member

This looks good to me.

@pcwalton
Copy link
Contributor

pcwalton commented Feb 9, 2015

I'm not a huge fan of the Az prefix leaking everywhere—the Az prefix is for the C binding layer only. Having one color type is of course great though. Could you perhaps reexport the AzColor as Color via pub use AzColor as Color?

@Adenilson
Copy link
Contributor Author

Agreed. Please check the updated patch.

(i.e. AzColor).

This patch will also move the auxiliar new() function to inside Servo
(together with rgb(), rgba(), black(), etc).

Also addresses reviewer's comment about AzColor.
@Adenilson
Copy link
Contributor Author

Needs rebase, will close this request and open a new one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants