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

Validators should be able to work with references without deref() or cloning #25

Open
jasongrlicky opened this issue Jan 25, 2018 · 0 comments

Comments

@jasongrlicky
Copy link
Contributor

Today:

let fill = FillStyle::Solid(Rgba::new(0.75, 0.5, 0.25, 1.0));
let mut d = CanvasMock::new();

// Set Expectations
d.expect_set_fill()
  .called_once()
  .with(deref(fill.clone()));

// Test
d.set_fill(&fill);

What would be awesome:

let fill = FillStyle::Solid(Rgba::new(0.75, 0.5, 0.25, 1.0));
let mut d = CanvasMock::new();

// Set Expectations
d.expect_set_fill()
  .called_once()
  .with(&fill);

// Test
d.set_fill(&fill);

I believe we can achieve this with lifetimes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant