Skip to content

Commit

Permalink
shut up clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
cecton committed Nov 5, 2023
1 parent 295877f commit ddb351c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ mod test {
use super::*;

fn host_library<T: ImplicitClone + Copy>(value: &T) -> T {
value.clone()
*value
}

macro_rules! host_library {
Expand Down

2 comments on commit ddb351c

@sylv256
Copy link

@sylv256 sylv256 commented on ddb351c Nov 6, 2023

Choose a reason for hiding this comment

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

why in the world were you cloning this

@cecton
Copy link
Member Author

@cecton cecton commented on ddb351c Nov 6, 2023

Choose a reason for hiding this comment

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

Long story short:

This function is originally meant to check that a type implements ImplicitClone and as an example of a function located on the host library that would clone references implicitly.

But in #42 I wanted to improve the testing to make sure the primitives types we implement ImplicitClone on are actually Copy so I added Copy. It kinda looked weird at that point because it makes less sense as an example. So right now I'm deciding if I should move the example to the general documentation as actual example and make the tests less documentation friendly.

I'm curious to hear your opinion on this @SylvKT, furry friend. Now that you've joined the conversation, can you share your thoughts on this discussion here: #42 (comment)?

cc @kirillsemyonkin

Please sign in to comment.