coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

cp: Use PathBuf instead of String for paths

Open tmccombs opened this issue 2 years ago • 8 comments

I think this should avoid unnecessarily validating utf-8, and avoids a few allocations.

tmccombs avatar Feb 12 '23 08:02 tmccombs

GNU testsuite comparison:

GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Feb 12 '23 09:02 github-actions[bot]

Good idea! Could you add a small test for this with some invalid utf-8, so we don't regress?

tertsdiepraam avatar Feb 12 '23 11:02 tertsdiepraam

Sure.

tmccombs avatar Feb 12 '23 19:02 tmccombs

GNU testsuite comparison:

GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Feb 12 '23 20:02 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Feb 13 '23 10:02 github-actions[bot]

GNU testsuite comparison:

Congrats! The gnu test tests/tail-2/inotify-dir-recreate is no longer failing!

github-actions[bot] avatar Feb 14 '23 11:02 github-actions[bot]

Looks like some test failures on macos and windows

jfinkels avatar Feb 18 '23 16:02 jfinkels

GNU testsuite comparison:

GNU test failed: tests/rm/rm2. tests/rm/rm2 is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Feb 18 '23 18:02 github-actions[bot]

hmm, it appears that mac won't actually let you create a file with an invalid utf-8 file name, and from some quick research windows might be similar? For now I've just restricted the tests to linux.

tmccombs avatar Feb 20 '23 06:02 tmccombs

GNU testsuite comparison:

GNU test failed: tests/tail-2/inotify-dir-recreate. tests/tail-2/inotify-dir-recreate is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Feb 20 '23 08:02 github-actions[bot]

GNU testsuite comparison:

GNU test failed: tests/misc/timeout. tests/misc/timeout is passing on 'main'. Maybe you have to rebase?

github-actions[bot] avatar Feb 20 '23 09:02 github-actions[bot]