MCPcopy Index your code
hub / github.com/RustPython/RustPython / borrow_constant

Method borrow_constant

crates/compiler-core/src/bytecode.rs:283–300  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

281 type Name = String;
282
283 fn borrow_constant(&self) -> BorrowedConstant<'_, Self> {
284 use BorrowedConstant::*;
285
286 match self {
287 Self::Integer { value } => Integer { value },
288 Self::Float { value } => Float { value: *value },
289 Self::Complex { value } => Complex { value: *value },
290 Self::Boolean { value } => Boolean { value: *value },
291 Self::Str { value } => Str { value },
292 Self::Bytes { value } => Bytes { value },
293 Self::Code { code } => Code { code },
294 Self::Tuple { elements } => Tuple { elements },
295 Self::Slice { elements } => Slice { elements },
296 Self::Frozenset { elements } => Frozenset { elements },
297 Self::None => None,
298 Self::Ellipsis => Ellipsis,
299 }
300 }
301}
302
303/// A Constant Bag

Callers 8

with_dumpMethod · 0.45
serialize_codeFunction · 0.45
fmt_displayMethod · 0.45
to_ownedMethod · 0.45
map_bagMethod · 0.45
map_clone_bagMethod · 0.45
fmtMethod · 0.45
fmt_disMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected