-
Notifications
You must be signed in to change notification settings - Fork 24
allow prefix to be any AsOsStr type, matching up with the contents of Path #1
Conversation
This was proposed some time back on the main repo, but I suggested against it as I didn't think that it was strongly motivated. Do you have a specific use case in mind where a strings do not suffice? |
@alexcrichton it seems your suggestion against it in the PR was simply an issue with the API at the time (the switch for BytesContainer to OsStr was still in progress). Other than that, I can't find any statement of what would be problematic about this the PR you've linked. As we now have AsOsStr, I'm not seeing how your previous concerns still apply. |
These were my specific concerns:
|
By "AsPath or AsOsStr", did you mean
So That said, it seems like the above sentence is saying "OsStr is a suffix to a path". That doesn't make sense, so I'll assume you meant "the argument is a suffix to a path". This is true, but it isn't a problem. |
Ah sorry I meant either trait would be the bound, not both.
Strictly speaking all TempDir::new(path, Path::new("suffix"))
Yes this PR is technically correct, but I believe it to be overengineered. The |
I disagree, people who have managed to realize that That said: in all likely hood, those who don't know about the semantics there will still have no issue using an API that has It is relatively simply not to over-restrict the type here. I don't see that as over engineering. |
I realize that the point about being over-engineered is subjective, but my original question still stands:
|
I'm presently using a filename as the prefix for tempdir. It's simply to communicate more information about the use of the particular tempdir to a user that stumbles across it. It isn't possible (or rather, it would be rather silly to) round trip through utf-8 because then I'd potentially lose having directory prefix that in any way corresponds to it's usage. |
d989460
to
716f70e
Compare
It's been a month since any comment was made here, please do one of the following:
|
Ah sorry for letting this fall through the cracks, I think this must have gotten lost in my email. This sort of change should always backwards compatible to do so I think I'd like to get some more experience without being so generic and see where it takes us. |
No description provided.