|
| 1 | +use std::{ |
| 2 | + fs::File, |
| 3 | + io::{BufRead, BufReader}, |
| 4 | + path::PathBuf, |
| 5 | +}; |
| 6 | +use ::serde::de::{Error, Visitor}; |
| 7 | +use std::sync::atomic::{AtomicBool, Ordering}; |
| 8 | +pub mod sample; |
| 9 | +extern crate test; |
| 10 | + |
| 11 | +Result<Self, D::Error> |
| 12 | + |
| 13 | +where D: serde::Deserializer<'de>, |
| 14 | + |
| 15 | +serde_json::from_str(&line) |
| 16 | +self.read_records::<smol_str::SmolStr>() |
| 17 | + |
| 18 | +pub static ALLOCATOR: alloc::Tracing = alloc::Tracing::new(); |
| 19 | + |
| 20 | +unsafe fn alloc(&self, layout: std::alloc::Layout) -> *mut u8 {} |
| 21 | + |
| 22 | +---------------------------------------------------- |
| 23 | + |
| 24 | +[ |
| 25 | + ["keyword", "use"], |
| 26 | + ["namespace", [ |
| 27 | + "std", |
| 28 | + ["punctuation", "::"] |
| 29 | + ]], |
| 30 | + ["punctuation", "{"], |
| 31 | + ["namespace", [ |
| 32 | + "fs", |
| 33 | + ["punctuation", "::"] |
| 34 | + ]], |
| 35 | + ["class-name", "File"], |
| 36 | + ["punctuation", ","], |
| 37 | + ["namespace", [ |
| 38 | + "io", |
| 39 | + ["punctuation", "::"] |
| 40 | + ]], |
| 41 | + ["punctuation", "{"], |
| 42 | + ["class-name", "BufRead"], |
| 43 | + ["punctuation", ","], |
| 44 | + ["class-name", "BufReader"], |
| 45 | + ["punctuation", "}"], |
| 46 | + ["punctuation", ","], |
| 47 | + ["namespace", [ |
| 48 | + "path", |
| 49 | + ["punctuation", "::"] |
| 50 | + ]], |
| 51 | + ["class-name", "PathBuf"], |
| 52 | + ["punctuation", ","], |
| 53 | + ["punctuation", "}"], |
| 54 | + ["punctuation", ";"], |
| 55 | + ["keyword", "use"], |
| 56 | + ["punctuation", "::"], |
| 57 | + ["namespace", [ |
| 58 | + "serde", |
| 59 | + ["punctuation", "::"], |
| 60 | + "de", |
| 61 | + ["punctuation", "::"] |
| 62 | + ]], |
| 63 | + ["punctuation", "{"], |
| 64 | + ["class-name", "Error"], |
| 65 | + ["punctuation", ","], |
| 66 | + ["class-name", "Visitor"], |
| 67 | + ["punctuation", "}"], |
| 68 | + ["punctuation", ";"], |
| 69 | + ["keyword", "use"], |
| 70 | + ["namespace", [ |
| 71 | + "std", |
| 72 | + ["punctuation", "::"], |
| 73 | + "sync", |
| 74 | + ["punctuation", "::"], |
| 75 | + "atomic", |
| 76 | + ["punctuation", "::"] |
| 77 | + ]], |
| 78 | + ["punctuation", "{"], |
| 79 | + ["class-name", "AtomicBool"], |
| 80 | + ["punctuation", ","], |
| 81 | + ["class-name", "Ordering"], |
| 82 | + ["punctuation", "}"], |
| 83 | + ["punctuation", ";"], |
| 84 | + ["keyword", "pub"], |
| 85 | + ["keyword", "mod"], |
| 86 | + ["module-declaration", "sample"], |
| 87 | + ["punctuation", ";"], |
| 88 | + ["keyword", "extern"], |
| 89 | + ["keyword", "crate"], |
| 90 | + ["module-declaration", "test"], |
| 91 | + ["punctuation", ";"], |
| 92 | + |
| 93 | + ["class-name", "Result"], |
| 94 | + ["operator", "<"], |
| 95 | + ["keyword", "Self"], |
| 96 | + ["punctuation", ","], |
| 97 | + ["class-name", "D"], |
| 98 | + ["punctuation", "::"], |
| 99 | + ["class-name", "Error"], |
| 100 | + ["operator", ">"], |
| 101 | + |
| 102 | + ["keyword", "where"], |
| 103 | + ["class-name", "D"], |
| 104 | + ["punctuation", ":"], |
| 105 | + ["namespace", [ |
| 106 | + "serde", |
| 107 | + ["punctuation", "::"] |
| 108 | + ]], |
| 109 | + ["class-name", "Deserializer"], |
| 110 | + ["operator", "<"], |
| 111 | + ["lifetime-annotation", "'de"], |
| 112 | + ["operator", ">"], |
| 113 | + ["punctuation", ","], |
| 114 | + |
| 115 | + ["namespace", [ |
| 116 | + "serde_json", |
| 117 | + ["punctuation", "::"] |
| 118 | + ]], |
| 119 | + ["function", "from_str"], |
| 120 | + ["punctuation", "("], |
| 121 | + ["operator", "&"], |
| 122 | + "line", |
| 123 | + ["punctuation", ")"], |
| 124 | + ["keyword", "self"], |
| 125 | + ["punctuation", "."], |
| 126 | + ["function", "read_records"], |
| 127 | + ["punctuation", "::"], |
| 128 | + ["operator", "<"], |
| 129 | + ["namespace", [ |
| 130 | + "smol_str", |
| 131 | + ["punctuation", "::"] |
| 132 | + ]], |
| 133 | + ["class-name", "SmolStr"], |
| 134 | + ["operator", ">"], |
| 135 | + ["punctuation", "("], |
| 136 | + ["punctuation", ")"], |
| 137 | + |
| 138 | + ["keyword", "pub"], |
| 139 | + ["keyword", "static"], |
| 140 | + ["constant", "ALLOCATOR"], |
| 141 | + ["punctuation", ":"], |
| 142 | + ["namespace", [ |
| 143 | + "alloc", |
| 144 | + ["punctuation", "::"] |
| 145 | + ]], |
| 146 | + ["class-name", "Tracing"], |
| 147 | + ["operator", "="], |
| 148 | + ["namespace", [ |
| 149 | + "alloc", |
| 150 | + ["punctuation", "::"] |
| 151 | + ]], |
| 152 | + ["class-name", "Tracing"], |
| 153 | + ["punctuation", "::"], |
| 154 | + ["function", "new"], |
| 155 | + ["punctuation", "("], |
| 156 | + ["punctuation", ")"], |
| 157 | + ["punctuation", ";"], |
| 158 | + |
| 159 | + ["keyword", "unsafe"], |
| 160 | + ["keyword", "fn"], |
| 161 | + ["function-definition", "alloc"], |
| 162 | + ["punctuation", "("], |
| 163 | + ["operator", "&"], |
| 164 | + ["keyword", "self"], |
| 165 | + ["punctuation", ","], |
| 166 | + " layout", |
| 167 | + ["punctuation", ":"], |
| 168 | + ["namespace", [ |
| 169 | + "std", |
| 170 | + ["punctuation", "::"], |
| 171 | + "alloc", |
| 172 | + ["punctuation", "::"] |
| 173 | + ]], |
| 174 | + ["class-name", "Layout"], |
| 175 | + ["punctuation", ")"], |
| 176 | + ["punctuation", "->"], |
| 177 | + ["operator", "*"], |
| 178 | + ["keyword", "mut"], |
| 179 | + ["keyword", "u8"], |
| 180 | + ["punctuation", "{"], |
| 181 | + ["punctuation", "}"] |
| 182 | +] |
| 183 | + |
| 184 | +---------------------------------------------------- |
| 185 | + |
| 186 | +Checks for namespaces. |
0 commit comments