cxx-qt icon indicating copy to clipboard operation
cxx-qt copied to clipboard

Add from<&String> to QAnyStringView

Open nicolasfella opened this issue 1 year ago • 3 comments

Makes constructing a QAnyStringView from String slightly less verbose

nicolasfella avatar Nov 17 '24 22:11 nicolasfella

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (39b3264) to head (ed664b2).

Additional details and impacted files
@@            Coverage Diff            @@
##              main     #1127   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           71        71           
  Lines        11927     11927           
=========================================
  Hits         11927     11927           

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov[bot] avatar Nov 17 '24 22:11 codecov[bot]

@nicolasfella I'm all for making this convenient. However, I'm wondering why the From<&str> implementation isn't sufficient... String should deref to &str, so in theory QAnyStringView::from(&my_string) should do the trick. And I assume the same works for my_string.into().

Can you share the exact code that this get's rid off.

LeonMatthesKDAB avatar Nov 23 '24 07:11 LeonMatthesKDAB

@nicolasfella ping?

redstrate avatar Dec 27 '24 20:12 redstrate