@@ -4,17 +4,17 @@ mod hex_stream;
44mod msgpack;
55mod protobuf;
66
7- use anyhow:: Result ;
8-
97pub use grpc:: GRPC ;
108pub use hex_dump:: HexDump ;
119pub use hex_stream:: HexStream ;
12- use mitmproxy_highlight:: Language ;
1310pub use msgpack:: MsgPack ;
1411pub use protobuf:: Protobuf ;
1512
13+ use anyhow:: Result ;
14+ use mitmproxy_highlight:: Language ;
15+
1616pub trait Metadata {
17- fn content_type ( & self ) -> Option < String > ;
17+ fn content_type ( & self ) -> Option < & str > ;
1818}
1919
2020pub trait Prettify : Send + Sync {
@@ -30,7 +30,8 @@ pub trait Prettify: Send + Sync {
3030
3131 fn prettify ( & self , data : & [ u8 ] , metadata : & dyn Metadata ) -> Result < String > ;
3232
33- fn render_priority ( & self , _data : & [ u8 ] , _metadata : & dyn Metadata ) -> f64 {
33+ #[ allow( unused_variables) ]
34+ fn render_priority ( & self , data : & [ u8 ] , metadata : & dyn Metadata ) -> f64 {
3435 0.0
3536 }
3637}
@@ -45,7 +46,7 @@ pub struct TestMetadata {
4546}
4647
4748impl Metadata for TestMetadata {
48- fn content_type ( & self ) -> Option < String > {
49- self . content_type . clone ( )
49+ fn content_type ( & self ) -> Option < & str > {
50+ self . content_type . as_deref ( )
5051 }
5152}
0 commit comments