1
0
mirror of https://github.com/BurntSushi/ripgrep.git synced 2025-01-19 05:49:14 +02:00

Fix path passed to try_create_bytes()

This commit is contained in:
Sebastian Nowicki 2017-10-16 15:29:55 +02:00 committed by Andrew Gallant
parent 712311fdc6
commit 363a4fa9b7

View File

@ -50,7 +50,8 @@ impl WorkDir {
/// Try to create a new file with the given name and contents in this
/// directory.
pub fn try_create<P: AsRef<Path>>(&self, name: P, contents: &str) -> io::Result<()> {
self.try_create_bytes(name, contents.as_bytes())
let path = self.dir.join(name);
self.try_create_bytes(path, contents.as_bytes())
}
/// Create a new file with the given name and size.