Benign cargo Download

proto.rs

Rust test marker or harnessimports base64
SHA-256fd28425aa15fcefb886d2671b8f9dda58f4c61e17c89b97d333f5d4031cacecd

Evidence

imports base64 lines 1–9
1use base64;
2use sha1;
3use std::convert::{From, Into};
4use std::fmt;
5
6use self::OpCode::*;
7/// Operation codes as part of rfc6455.
8#[derive(Debug, Eq, PartialEq, Clone, Copy)]
9pub en …
English function-word token "for" lines 22–29
22:37… was received.
23 Bad,
24}
25
26impl fmt::Display for OpCode {
27 fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
28 match *self {
29 …
imports self::CloseCode::* lines 69–81
69:3… _ => Bad,
70 }
71 }
72}
73
74use self::CloseCode::*;
75/// Status code used to indicate why an endpoint is closing the `WebSocket`
76/// connection.
77#[derive(Debug, Eq, PartialEq, Clone, Copy)]
78pub enum CloseCode {
79 /// Indicates a normal closure, meaning that the purpose for
80 /// which the connection was established has been fulfilled.
81 Normal, …
imports super::* lines 216–228
216:30… bytes());
217
218 base64::encode(&hasher.digest().bytes())
219}
220
221#[cfg(test)]
222mod test {
223 #![allow(unused_imports, unused_variables, dead_code)]
224 use super::*;
225
226 macro_rules! opcode_into {
227 ($from:expr => $opcode:pat) => {
228 match …
#[test] attribute lines 240–249
240:20… > unreachable!("{:?}", e),
241 }
242 };
243 }
244
245 #[test]
246 fn test_to_opcode() {
247 opcode_into!(0 => OpCode::Continue);
248 opcode_into!(1 => OpCode::Text);
249 opc …

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.