mirror of
https://github.com/Orange-OpenSource/hurl.git
synced 2024-12-25 03:52:09 +03:00
Merge pull request #175 from Orange-OpenSource/fix/reading-body-file
Fix reading body file bytes
This commit is contained in:
commit
4a730e9fde
@ -17,8 +17,6 @@
|
||||
*/
|
||||
|
||||
use std::collections::HashMap;
|
||||
use std::fs::File;
|
||||
use std::io::prelude::*;
|
||||
use std::path::Path;
|
||||
|
||||
use hurl_core::ast::*;
|
||||
@ -63,14 +61,8 @@ pub fn eval_bytes(
|
||||
.unwrap()
|
||||
.to_string()
|
||||
};
|
||||
match File::open(absolute_filename.clone()) {
|
||||
Ok(f) => {
|
||||
let mut bytes = vec![];
|
||||
for byte in f.bytes() {
|
||||
bytes.push(byte.unwrap());
|
||||
}
|
||||
Ok(bytes)
|
||||
}
|
||||
match std::fs::read(absolute_filename.clone()) {
|
||||
Ok(bytes) => Ok(bytes),
|
||||
Err(_) => Err(Error {
|
||||
source_info: filename.source_info,
|
||||
inner: RunnerError::FileReadAccess {
|
||||
|
Loading…
Reference in New Issue
Block a user