Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Linux/rust/pin-init/examples/   (Open Source Betriebssystem Version 6.17.9©)  Datei vom 24.10.2025 mit Größe 478 B image not shown  

Quelle  error.rs   Sprache: unbekannt

 
// SPDX-License-Identifier: Apache-2.0 OR MIT

#![cfg_attr(feature = "alloc", feature(allocator_api))]

use core::convert::Infallible;

#[cfg(feature = "alloc")]
use std::alloc::AllocError;

#[derive(Debug)]
pub struct Error;

impl From<Infallible> for Error {
    fn from(e: Infallible) -> Self {
        match e {}
    }
}

#[cfg(feature = "alloc")]
impl From<AllocError> for Error {
    fn from(_: AllocError) -> Self {
        Self
    }
}

#[allow(dead_code)]
fn main() {}

[ Dauer der Verarbeitung: 0.11 Sekunden  (vorverarbeitet)  ]