clippy: as_bytes on string literals
This commit is contained in:
parent
2b338c3549
commit
f2a0ca259e
|
@ -145,7 +145,7 @@ impl OutPaths {
|
|||
|
||||
fn place_nix(&self) {
|
||||
let mut file = File::create(self.nix_path()).expect("Failed to create nix out path check");
|
||||
file.write_all(include_str!("outpaths.nix").as_bytes())
|
||||
file.write_all(include_bytes!("outpaths.nix"))
|
||||
.expect("Failed to place outpaths.nix");
|
||||
}
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ impl<E: stats::SysEvents + 'static> worker::SimpleWorker for StatCollectorWorker
|
|||
match serde_json::from_slice(body) {
|
||||
Ok(e) => Ok(e),
|
||||
Err(_) => {
|
||||
let mut modified_body: Vec<u8> = vec!["\"".as_bytes()[0]];
|
||||
let mut modified_body: Vec<u8> = vec![b"\""[0]];
|
||||
modified_body.append(&mut body.to_vec());
|
||||
modified_body.push("\"".as_bytes()[0]);
|
||||
modified_body.push(b"\""[0]);
|
||||
|
||||
match serde_json::from_slice(&modified_body) {
|
||||
Ok(e) => {
|
||||
|
|
|
@ -54,7 +54,7 @@ impl LineWriter {
|
|||
self.file
|
||||
.write_all(self.buffer.join("\n").as_bytes())
|
||||
.unwrap();
|
||||
self.file.write("\n".as_bytes()).unwrap();
|
||||
self.file.write(b"\n").unwrap();
|
||||
} else {
|
||||
// println!("taking the append option");
|
||||
// println!("Writing {:?} to line {}", data, line);
|
||||
|
@ -70,7 +70,7 @@ impl LineWriter {
|
|||
// end
|
||||
// println!("selected buffer: {:?}", to_write);
|
||||
self.file.write(to_write.as_bytes()).unwrap();
|
||||
self.file.write("\n".as_bytes()).unwrap();
|
||||
self.file.write(b"\n").unwrap();
|
||||
}
|
||||
|
||||
self.last_line = line;
|
||||
|
|
Loading…
Reference in a new issue