Benign rust 2,021 installs Download

yog-ui 0.41.1

“Yog UI framework — flexbox and WPF-style grid layout + GPU rendering via yog-gfx”

Rust test marker or harnessimports std::ffi::c_void
SHA-2562dc954c4ed156c0cc628051a1425183863c2bbc7c0c002d7b76f6532ce2b55a0

Evidence

Rust decodes radix-16 bytes component.rs · lines 536–546
536:24… trip_prefix("0X"))?
537 .replace('_', "");
538 let n = u32::from_str_radix(&hex, 16).ok()?;
539 match hex.len() {
540 6 => Some(0xFF00_0000 | n),
⋯6 lines
imports std::ffi::c_void component.rs · lines 558–573
558:58… rs `false` and an
559/// error message.
560pub mod designer {
561 use std::ffi::c_void;
562 use std::fmt::Write as _;
563 use std::panic::{AssertUnwindSafe, catch_unwind};
564
565 use yog_abi::{YogGfxApi, YogStr};
566 use yog_gfx::GfxContext;
567
568 use super::{COMMON_ATTRS, PropKind, Props, apply_style, components, find};
569 use crate::widget::{self, Widget};
570 use crate::{FlexDir, UiRoot, Units};
571
572 /// Version of this protocol; the designer host refuses others.
573 pub const ABI: u32 = …
Rust replaces matched string content component.rs · lines 763–775
763:42… nd `\n` escaped.
764 pub fn escape(v: &str) -> String {
765 v.replace('\\', "\\\\").replace('\n', "\\n")
766 }
767}
768
769#[cfg(test)]
770mod tests {
771 use super::*;
772
773 struct Badge;
774 impl Component for Badge {
775 const NAME: &'static str = "TestBadge"; …
assert_eq! macro component.rs · lines 785–795
785:36… )
786 .padding(1.0, 2.0, 1.0, 2.0)
787 }
788 }
789
790 #[test]
791 fn props_fall_back_to_defaults() {
792 let p = Props::new(Badge::PROPS, &[("label", "@@x"), ("n", " 2.5 ")]);
793 assert_eq!(p.text("label"), "@x");
794 assert_eq!(p.color("fill"), 0xFF3060C0);
795 assert_eq!(p.w …
#[cfg(test)] attribute rich.rs · lines 293–300
293:38… ring {
294 spans.iter().map(|a| format!("{{{a}|")).collect()
295}
296
297#[cfg(test)]
298mod tests {
299 /// `width` as it was computed before it stopped allocating: through `runs`.
300 fn width_via_runs(s: &str, adv …

No evidence locations were recorded for this file. Raw result

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.