mirror of
https://github.com/servo/servo.git
synced 2025-08-13 09:25:32 +01:00
Eliminates need to box response reader
I don't know how idiomatic this is for rust, but the only way I could think of to do this is with a union enum and generics. As the number of decoders should never be more than a few, this shouldn't really be a problem.
This commit is contained in:
parent
879b058be2
commit
6064ee8756
2 changed files with 29 additions and 11 deletions
|
@ -496,7 +496,7 @@ fn test_load_follows_a_redirect() {
|
|||
match load::<MockRequest>(load_data, resource_mgr, None, &Factory) {
|
||||
Err(_) => panic!("expected to follow a redirect"),
|
||||
Ok(mut lr) => {
|
||||
let response = read_response(&mut *lr.reader);
|
||||
let response = read_response(&mut lr);
|
||||
assert_eq!(response, "Yay!".to_string());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue