sociomantic-tsunami / ocean

General purpose, platform-dependent, high-performance library for D
Other
61 stars 56 forks source link

Formatter: Support Phobos like OutputRange interface #866

Closed Geod24 closed 2 years ago

Geod24 commented 2 years ago

Before this patch, printing a SysTime would fail because we were passing a literal, which would not implicitly convert to a 'ref'.

Geod24 commented 2 years ago

Using the CI to test as I don't have a Linux at hand. Added the test, should go red, will add the fix after, which is one line.

Geod24 commented 2 years ago
./src/ocean/text/convert/Formatter.d(468): Error: template `ocean.text.convert.Formatter_test.__unittest_L580_C1.SysTime.toString` cannot deduce function from argument types `!()(void delegate(const(char[]) e) @system)`, candidates are:
./src/ocean/text/convert/Formatter_test.d(585):        `toString(W)(ref W writer)`
./src/ocean/text/convert/Formatter.d(279): Error: template instance `ocean.text.convert.Formatter.handle!(SysTime)` error instantiating
./src/ocean/text/convert/Formatter.d(137):        instantiated from here: `sformat!(SysTime)`
./src/ocean/text/convert/Formatter_test.d(587):        instantiated from here: `format!(SysTime)`
make: *** [/home/runner/work/ocean/ocean/build/prod/tmp/allunittests] Error 1
submodules/makd/Makd.mak:574: recipe for target '/home/runner/work/ocean/ocean/build/prod/tmp/allunittests' failed

Bingo

codecov[bot] commented 2 years ago

Codecov Report

Merging #866 (639f715) into v6.x.x (82171e4) will increase coverage by 0.00%. The diff coverage is 100.00%.