temp-dir/temp-file: Fix leak-after-clone, remove incorrect impls, clean up API
Fixes #17 (closed).
This is a breaking API change, hence the minor version bumps:
-
TempDir::cleanup()
,TempDir::leak()
, andTempDir::panic_on_cleanup_error()
no longer takeself
by value. -
TempFile::cleanup()
,TempFile::leak()
, andTempFile::panic_on_cleanup_error()
no longer takeself
by value. -
TempFile::with_contents()
no longer takesself
by value, and is renamed toTempFile::write()
. - Removed impls for
Hash
,Ord
forTempDir
andTempFile
.
Note that CI is failing due to bumping temp-file
's dependency on temp-dir
to an unpublished version.
Impls for Hash
and Ord
were removed because they do not make sense for something Clonable with internal mutability. An instance of Ord
that respects pointer equality would give surprising behavior for two TempDirs
that are identical by value, and vice versa. It would be possible to implement Hash
in a way that respects pointer equality, but this would give surprising behavior w.r.t internal mutability.
Edited by A L Manning