MCPcopy Create free account
hub / github.com/cretz/stackparam / read_attributes

Method read_attributes

src/bytecode/io/reader.rs:280–296  ·  view source on GitHub ↗
(reader: &mut BlockReader, cf: &ClassFragment)

Source from the content-addressed store, hash-verified

278 }
279
280 fn read_attributes(reader: &mut BlockReader, cf: &ClassFragment) -> Result<Vec<Attribute>, Error> {
281 match reader.read_u16() {
282 Ok(attr_len) => (0..attr_len).fold(Ok(vec![]), |acc, _| {
283 match acc {
284 Ok(mut attributes) => match ClassReader::read_attribute(reader, cf) {
285 Ok(attribute) => {
286 attributes.push(attribute);
287 Ok(attributes)
288 },
289 Err(err) => Err(err)
290 },
291 err@_ => err
292 }
293 }),
294 Err(err) => Err(err)
295 }
296 }
297
298 fn read_attribute(reader: &mut BlockReader, cf: &ClassFragment) -> Result<Attribute, Error> {
299 match reader.read_u16() {

Callers

nothing calls this directly

Calls 1

read_u16Method · 0.80

Tested by

no test coverage detected