Fix map_clone and explicit truncate when file is create

Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
Christian König 2024-03-31 11:35:36 +00:00
parent 9929635b5b
commit 2cd2346edb
No known key found for this signature in database
2 changed files with 2 additions and 7 deletions

View file

@ -513,13 +513,7 @@ impl Session {
} }
pub fn get_user_attribute(&self, key: &str) -> Option<String> { pub fn get_user_attribute(&self, key: &str) -> Option<String> {
self.0 self.0.data.read().user_data.attributes.get(key).cloned()
.data
.read()
.user_data
.attributes
.get(key)
.map(Clone::clone)
} }
fn weak(&self) -> SessionWeak { fn weak(&self) -> SessionWeak {

View file

@ -66,6 +66,7 @@ impl Sink for StdoutSink {
OpenOptions::new() OpenOptions::new()
.write(true) .write(true)
.create(true) .create(true)
.truncate(true)
.open(file) .open(file)
.map_err(|e| StdoutError::OpenFailure { .map_err(|e| StdoutError::OpenFailure {
file: file.to_string(), file: file.to_string(),