mirror of
https://github.com/iluvcapra/bwavfile.git
synced 2025-12-31 08:50:44 +00:00
clippy: Use a slice argument instead of the owned equivalent
This commit is contained in:
@@ -21,11 +21,7 @@ pub trait ReadBWaveChunks: Read {
|
|||||||
|
|
||||||
pub trait WriteBWaveChunks: Write {
|
pub trait WriteBWaveChunks: Write {
|
||||||
fn write_wave_fmt(&mut self, format: &WaveFmt) -> Result<(), ParserError>;
|
fn write_wave_fmt(&mut self, format: &WaveFmt) -> Result<(), ParserError>;
|
||||||
fn write_bext_string_field(
|
fn write_bext_string_field(&mut self, string: &str, length: usize) -> Result<(), ParserError>;
|
||||||
&mut self,
|
|
||||||
string: &String,
|
|
||||||
length: usize,
|
|
||||||
) -> Result<(), ParserError>;
|
|
||||||
fn write_bext(&mut self, bext: &Bext) -> Result<(), ParserError>;
|
fn write_bext(&mut self, bext: &Bext) -> Result<(), ParserError>;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -51,13 +47,9 @@ where
|
|||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
fn write_bext_string_field(
|
fn write_bext_string_field(&mut self, string: &str, length: usize) -> Result<(), ParserError> {
|
||||||
&mut self,
|
|
||||||
string: &String,
|
|
||||||
length: usize,
|
|
||||||
) -> Result<(), ParserError> {
|
|
||||||
let mut buf = ASCII
|
let mut buf = ASCII
|
||||||
.encode(&string, EncoderTrap::Ignore)
|
.encode(string, EncoderTrap::Ignore)
|
||||||
.expect("Error encoding text");
|
.expect("Error encoding text");
|
||||||
buf.truncate(length);
|
buf.truncate(length);
|
||||||
let filler_length = length - buf.len();
|
let filler_length = length - buf.len();
|
||||||
|
|||||||
Reference in New Issue
Block a user