Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/toml_writer/src/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 1 kB image not shown  

Quelle  key.rs

  Sprache: Rust
 

#[cfg(feature = "alloc")]
use alloc::borrow::Cow;
#[cfg(feature = "alloc")]
use alloc::string::String;

use crate::TomlWrite;

#[cfg(feature = "alloc")]
pub trait ToTomlKey {
    fn to_toml_key(&self) -> String;
}

#[cfg(feature = "alloc")]
impl<T> ToTomlKey for T
where
    T: WriteTomlKey + ?Sized,
{
    fn to_toml_key(&self) -> String {
        let mut result = String::new();
        let _ = self.write_toml_key(&mut result);
        result
    }
}

pub trait WriteTomlKey {
    fn write_toml_key<W: TomlWrite + ?Sized>(&self, writer: &='color:red'>mut W) -> core::fmt::Result;
}

impl WriteTomlKey for str {
    fn write_toml_key<W: TomlWrite + ?Sized>(&self, writer: &='color:red'>mut W) -> core::fmt::Result {
        crate::TomlKeyBuilder::new(self)
            .as_default()
            .write_toml_key(writer)
    }
}

#[cfg(feature = "alloc")]
impl WriteTomlKey for String {
    fn write_toml_key<W: TomlWrite + ?Sized>(&self, writer: &='color:red'>mut W) -> core::fmt::Result {
        self.as_str().write_toml_key(writer)
    }
}

#[cfg(feature = "alloc")]
impl WriteTomlKey for Cow<'_, str> {
    fn write_toml_key<W: TomlWrite + ?Sized>(&self, writer: &='color:red'>mut W) -> core::fmt::Result {
        self.as_ref().write_toml_key(writer)
    }
}

impl<V: WriteTomlKey + ?Sized> WriteTomlKey for &V {
    fn write_toml_key<W: TomlWrite + ?Sized>(&self, writer: &='color:red'>mut W) -> core::fmt::Result {
        (*self).write_toml_key(writer)
    }
}

Messung V0.5 in Prozent
C=87 H=95 G=90

¤ Dauer der Verarbeitung: 0.2 Sekunden  ¤

*© 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.