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

Small cleanups #874

Merged
merged 2 commits into from
Aug 17, 2023
Merged

Small cleanups #874

merged 2 commits into from
Aug 17, 2023

Conversation

psychon
Copy link
Owner

@psychon psychon commented Aug 17, 2023

Just some random stuff that hopefully improves things and that I had laying around for a while.

Instead of using "match" and "return", we can just use "?" to simplify
this code.

Signed-off-by: Uli Schlachter <[email protected]>
This code has a constant with value 18. So far, this constant was kept
as a u32. There is one place that needs this value as a usize. This
conversion was done with try_into().unwrap().

This commit removes that unwrap() by changing the type of the constant
to u16, which can be converted to usize via into().

Signed-off-by: Uli Schlachter <[email protected]>
@codecov
Copy link

codecov bot commented Aug 17, 2023

Codecov Report

Patch coverage: 25.00% and no project coverage change.

Comparison is base (2e9dbb5) 12.72% compared to head (6bc90f2) 12.72%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #874   +/-   ##
=======================================
  Coverage   12.72%   12.72%           
=======================================
  Files         188      188           
  Lines      137957   137955    -2     
=======================================
  Hits        17559    17559           
+ Misses     120398   120396    -2     
Flag Coverage Δ
tests 12.72% <25.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
x11rb/src/cookie.rs 26.11% <0.00%> (+0.48%) ⬆️
x11rb/src/properties.rs 64.32% <33.33%> (-0.08%) ⬇️

... and 2 files with indirect coverage changes

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

Copy link
Collaborator

@notgull notgull left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@mergify mergify bot merged commit 3045792 into master Aug 17, 2023
@mergify mergify bot deleted the cleanup branch August 17, 2023 14:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants