mirror of
https://github.com/sharkdp/hyperfine.git
synced 2026-11-01 08:50:19 +00:00
Use String instead of bytes, change error handling
This commit is contained in:
1 parent
bd81fe65a2
commit
4b8cc34815
3 files changed
+18
-15
No files matched your search
@@ -70,7 +70,7 @@ pub enum ExportType {
|
||||
/// Interface for different exporters.
|
||||
trait Exporter {
|
||||
/// Export the given entries in the serialized form.
|
||||
fn serialize(&self, values: &Vec<ExportEntry>) -> Result<Vec<u8>>;
|
||||
fn serialize(&self, results: &Vec<ExportEntry>) -> Result<String>;
|
||||
}
|
||||
|
||||
/// Handles the management of multiple file exporters.
|
||||
@@ -107,8 +107,8 @@ impl ExportManager {
|
||||
}
|
||||
|
||||
/// Write the given content to a file with the specified name
|
||||
fn write_to_file(filename: &str, content: Vec<u8>) -> Result<()> {
|
||||
fn write_to_file(filename: &str, content: String) -> Result<()> {
|
||||
let mut file = File::create(filename)?;
|
||||
file.write_all(&content)?;
|
||||
file.write_all(content.as_bytes())?;
|
||||
Ok(())
|
||||
}
|
||||
Reference in new issue
Block a user