mirror of
https://github.com/librespot-org/librespot.git
synced 2025-10-04 10:19:27 +02:00
Update to Rust 2018
- Fix deprecated Error::cause warnings and missing dyn - Reset max_width - Add rustfmt to Travis - Run rustfmt on full codebase with `cargo fmt --all` - Add rustfmt to Travis - Complete migration to edition 2018 - Replace try! shorthand - Use explicit `dyn Trait`
This commit is contained in:
parent
be2ad9059a
commit
d26590afc5
45 changed files with 331 additions and 238 deletions
|
@ -4,7 +4,7 @@ use std::io::{self, Write};
|
|||
use std::mem;
|
||||
use std::slice;
|
||||
|
||||
pub struct StdoutSink(Box<Write>);
|
||||
pub struct StdoutSink(Box<dyn Write>);
|
||||
|
||||
impl Open for StdoutSink {
|
||||
fn open(path: Option<String>) -> StdoutSink {
|
||||
|
@ -28,7 +28,10 @@ impl Sink for StdoutSink {
|
|||
|
||||
fn write(&mut self, data: &[i16]) -> io::Result<()> {
|
||||
let data: &[u8] = unsafe {
|
||||
slice::from_raw_parts(data.as_ptr() as *const u8, data.len() * mem::size_of::<i16>())
|
||||
slice::from_raw_parts(
|
||||
data.as_ptr() as *const u8,
|
||||
data.len() * mem::size_of::<i16>(),
|
||||
)
|
||||
};
|
||||
|
||||
self.0.write_all(data)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue