Debian Codegraph @

examples/mprintf.rs

raw symbols SCIP
1 use pracstrorust-analyzer cargo pracstro 1.1.1 crate/::{moonrust-analyzer cargo pracstro 1.1.1 moon/, timerust-analyzer cargo pracstro 1.1.1 time/};
2
3 const HALFMONrust-analyzer cargo pracstro 1.1.1 HALFMON.: f64 = 14.76529434;
4 const EMOJISrust-analyzer cargo pracstro 1.1.1 EMOJIS.: [&str; 8] = ["🌑", "🌒", "🌓", "🌔", "🌕", "🌖", "🌗", "🌘"];
5 //const SEMOJI: [&str; 8] = ["🌑", "🌘", "🌗", "🌖", "🌕", "🌔", "🌓", "🌒"];
6 const PNAMESrust-analyzer cargo pracstro 1.1.1 PNAMES.: [&str; 8] = [
7 "New",
8 "Waxing Crescent",
9 "First Quarter",
10 "Waxing Gibbous",
11 "Full",
12 "Waning Gibbous",
13 "Last Quarter",
14 "Waning Crescent",
15 ];
16
17 fn phaseidxrust-analyzer cargo pracstro 1.1.1 phaseidx().(ilumfrac: f64, mage: f64) -> usize {
18 let half: bool = mage rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f64][`PartialOrd<Self>`]gt().>rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f64][`PartialOrd<Self>`]gt(). rust-analyzer cargo core https://github.com/rust-lang/rust/library/core cmp/impls/impl#[f64][`PartialOrd<Self>`]gt().HALFMONrust-analyzer cargo pracstro 1.1.1 HALFMON.;
19 match (ilumfrac, half) {
20 (0.00..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#0.04, _) => 0,
21 (0.96..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#1.00, _) => 4,
22 (0.46..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#0.54, true) => 6,
23 (0.46..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#0.54, false) => 2,
24 (0.54..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#0.96, true) => 5,
25 (0.54..rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/range/Range#0.96, false) => 3,
26 (_, true) => 7,
27 (_, false) => 1,
28 }
29 }
30
31 fn mainrust-analyzer cargo pracstro 1.1.1 main().() {
32 let p = (
33 moonrust-analyzer cargo pracstro 1.1.1 moon/::MOONrust-analyzer cargo pracstro 1.1.1 moon/MOON..illumfracrust-analyzer cargo pracstro 1.1.1 moon/impl#[Moon]illumfrac().(timerust-analyzer cargo pracstro 1.1.1 time/::Daterust-analyzer cargo pracstro 1.1.1 time/Date#::nowrust-analyzer cargo pracstro 1.1.1 time/impl#[Date]now().()),
34 moonrust-analyzer cargo pracstro 1.1.1 moon/::MOONrust-analyzer cargo pracstro 1.1.1 moon/MOON..phaseagerust-analyzer cargo pracstro 1.1.1 moon/impl#[Moon]phaseage().(timerust-analyzer cargo pracstro 1.1.1 time/::Daterust-analyzer cargo pracstro 1.1.1 time/Date#::nowrust-analyzer cargo pracstro 1.1.1 time/impl#[Date]now().()),
35 );
36 printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!(
37 "{} {} ({:.2}%)",
38 PNAMESrust-analyzer cargo pracstro 1.1.1 PNAMES.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().phaseidxrust-analyzer cargo pracstro 1.1.1 phaseidx().(p.0, p.1)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().,
39 EMOJISrust-analyzer cargo pracstro 1.1.1 EMOJIS.[rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().phaseidxrust-analyzer cargo pracstro 1.1.1 phaseidx().(p.0, p.1)]rust-analyzer cargo core https://github.com/rust-lang/rust/library/core array/impl#[`[T; N]`][`Index<I>`]index().,
40 p.0 *rust-analyzer cargo core https://github.com/rust-lang/rust/library/core ops/arith/impl#[f64][`Mul<Self>`]mul(). 100.0
41 );
42 }