From b4295c14cab39461b9faa3fe43a8d60f8bd65c47 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Sun, 14 Aug 2022 23:39:37 +0200 Subject: [PATCH] fix write panic --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 0d4a38a..e57d1e1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -272,7 +272,7 @@ fn receiver(args: &Vec) { let mut buf: Vec = Vec::new(); buf.resize(br as usize, 0); let mut buf: &[u8] = buf.leak(); - let mut file = OpenOptions::new().truncate(false).open(args.get(4).unwrap_or_else(|| { + let mut file = OpenOptions::new().truncate(false).write(true).create(true).open(&args.get(4).unwrap_or_else(|| { print_args(args); panic!("unreachable") }))