Skip to content

Conversation

@Turbo87
Copy link
Member

@Turbo87 Turbo87 commented Oct 14, 2024

We aren't actually using the Emails instance in this test suite, so we may as well remove it and simplify the Faker struct to be a module with regular functions instead :)

/cc @LawnGnome

If `create_or_update()` is called with a `None` argument then no emails will be saved and sent, which means that the `Emails` instance isn't actually being used and created for nothing. Additionally, we don't need the "upsert" behavior since our test database shouldn't start with any content anyway.

In other words: we can just `INSERT` the `NewUser` instance directly and remove the `email` field from the `Faker` struct.
Since the `Faker` struct has no fields anymore, we may as well convert these to regular functions that don't need an instance of the struct.
@Turbo87 Turbo87 added C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear A-backend ⚙️ labels Oct 14, 2024
@codecov
Copy link

codecov bot commented Oct 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.68%. Comparing base (ed4eb9f) to head (046a9d8).
Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9665      +/-   ##
==========================================
- Coverage   88.68%   88.68%   -0.01%     
==========================================
  Files         288      288              
  Lines       29369    29353      -16     
==========================================
- Hits        26047    26032      -15     
+ Misses       3322     3321       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Turbo87 Turbo87 merged commit 1fda8c1 into rust-lang:main Oct 15, 2024
10 checks passed
@Turbo87 Turbo87 deleted the typosquat-tests branch October 15, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-backend ⚙️ C-internal 🔧 Category: Nonessential work that would make the codebase more consistent or clear

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant