Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/anyhow/tests/ui/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 612 B image not shown  

Quelle  ensure-nonbool.rs

  Sprache: Rust
 

use anyhow::{ensure, Result};
use std::ops::{Deref, Not};

struct Bool(bool);

struct DerefBool(bool);

struct NotBool(bool);

impl Deref for DerefBool {
    type Target = bool;
    fn deref(&self) -> &Self::Target {
        &self.0
    }
}

impl Not for NotBool {
    type Output = bool;
    fn not(self) -> Self::Output {
        !self.0
    }
}

fn main() -> Result<()> {
    ensure!("...");

    let mut s = Bool(true);
    match &mut s {
        Bool(cond) => ensure!(cond),
    }

    let db = DerefBool(true);
    ensure!(db);
    ensure!(&db);

    let nb = NotBool(true);
    ensure!(nb);

    Ok(())
}

Messung V0.5 in Prozent
C=100 H=100 G=100

¤ Dauer der Verarbeitung: 0.22 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.