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> {
self.0
.data
.read()
.user_data
.attributes
.get(key)
.map(Clone::clone)
self.0.data.read().user_data.attributes.get(key).cloned()
}
fn weak(&self) -> SessionWeak {

View file

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