mirror of
https://github.com/librespot-org/librespot.git
synced 2024-11-08 16:45:43 +00:00
Fix map_clone and explicit truncate when file is create
Signed-off-by: Christian König <ckoenig@posteo.de>
This commit is contained in:
parent
9929635b5b
commit
2cd2346edb
2 changed files with 2 additions and 7 deletions
|
@ -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 {
|
||||||
|
|
|
@ -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(),
|
||||||
|
|
Loading…
Reference in a new issue