Skip to content
This repository has been archived by the owner. It is now read-only.

Add clone macro #527

Merged
merged 15 commits into from Nov 14, 2019
Merged

Add clone macro #527

merged 15 commits into from Nov 14, 2019

Conversation

@antoyo
Copy link
Member

@antoyo antoyo commented Oct 22, 2019

No description provided.

examples/clone.rs Outdated Show resolved Hide resolved
examples/clone.rs Outdated Show resolved Hide resolved
examples/clone.rs Outdated Show resolved Hide resolved
examples/clone.rs Outdated Show resolved Hide resolved
src/clone.rs Outdated Show resolved Hide resolved
tests/clone_panic.rs Outdated Show resolved Hide resolved
tests/clone_panic.rs Outdated Show resolved Hide resolved
src/clone.rs Outdated Show resolved Hide resolved
Cargo.toml Outdated Show resolved Hide resolved
@antoyo
Copy link
Member Author

@antoyo antoyo commented Oct 22, 2019

@sdroege @EPashkin @GuillaumeGomez I think this is ready for another round of review.

tests/clone.rs Show resolved Hide resolved
src/clone.rs Outdated Show resolved Hide resolved
src/clone.rs Show resolved Hide resolved
src/clone.rs Outdated Show resolved Hide resolved
src/clone.rs Outdated Show resolved Hide resolved
@sdroege sdroege mentioned this pull request Oct 22, 2019
43 tasks
@antoyo
Copy link
Member Author

@antoyo antoyo commented Oct 23, 2019

Tests fail because I use ? in macros which is not supported in edition 2015.

@antoyo
Copy link
Member Author

@antoyo antoyo commented Oct 23, 2019

So, there's a problem when implementing the trait in the other crates:
only traits defined in the current crate can be implemented for arbitrary types.

@sdroege
Copy link
Member

@sdroege sdroege commented Oct 23, 2019

So, there's a problem when implementing the trait in the other crates:
only traits defined in the current crate can be implemented for arbitrary types.

You only have to implement it on the final type, not on all types in the class hierarchy. Otherwise you'd implement it multiple times for the same type anyway.

src/object.rs Show resolved Hide resolved
src/object.rs Outdated Show resolved Hide resolved
src/clone.rs Outdated Show resolved Hide resolved
src/clone.rs Show resolved Hide resolved
src/clone.rs Show resolved Hide resolved
src/clone.rs Show resolved Hide resolved
src/clone.rs Show resolved Hide resolved
src/clone.rs Outdated Show resolved Hide resolved
src/clone.rs Show resolved Hide resolved
src/clone.rs Show resolved Hide resolved
@sdroege
Copy link
Member

@sdroege sdroege commented Nov 11, 2019

@antoyo You're going to work on the remaining parts?

@antoyo
Copy link
Member Author

@antoyo antoyo commented Nov 11, 2019

@sdroege: I won't have time soon.

@sdroege sdroege force-pushed the feature/clone-macro branch from ff3a013 to 90eb5ec Nov 12, 2019
@sdroege
Copy link
Member

@sdroege sdroege commented Nov 12, 2019

Should be good to go now

src/object.rs Outdated Show resolved Hide resolved
@sdroege
Copy link
Member

@sdroege sdroege commented Nov 12, 2019

@sdroege
Copy link
Member

@sdroege sdroege commented Nov 13, 2019

@GuillaumeGomez Also let me know if you want me to merge it ;)

src/clone.rs Outdated
};
}

/// Macro for passing variables as strong or weak references into a closure.
Copy link
Member

@GuillaumeGomez GuillaumeGomez Nov 14, 2019

Choose a reason for hiding this comment

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

"variables as strong" -> there is one extra whitespace after "variables".

src/clone.rs Outdated
/// returned.
///
/// ### Passing a strong reference
/// ```rust
Copy link
Member

@GuillaumeGomez GuillaumeGomez Nov 14, 2019

Choose a reason for hiding this comment

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

Please add an empty line before the example (makes the code simpler to read).

src/clone.rs Outdated
/// ```
///
/// ### Passing a strong and weak reference
/// ```rust
Copy link
Member

@GuillaumeGomez GuillaumeGomez Nov 14, 2019

Choose a reason for hiding this comment

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

Please add an empty line before the example (makes the code simpler to read).

src/clone.rs Outdated
/// ```
///
/// ### Providing a default return value if upgrading a weak reference fails
/// ```rust
Copy link
Member

@GuillaumeGomez GuillaumeGomez Nov 14, 2019

Choose a reason for hiding this comment

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

Please add an empty line before the example (makes the code simpler to read).

@GuillaumeGomez GuillaumeGomez merged commit 5613e42 into gtk-rs:master Nov 14, 2019
1 of 2 checks passed
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants