Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/third_party/rust/derive_more/tests/   (Browser von der Mozilla Stiftung Version 136.0.1©)  Datei vom 10.2.2025 mit Größe 611 B image not shown  

Quelle  sum.rs   Sprache: unbekannt

 
Spracherkennung für: .rs vermutete Sprache: Unknown {[0] [0] [0]} [Methode: Schwerpunktbildung, einfache Gewichte, sechs Dimensionen]

#![cfg_attr(not(feature = "std"), no_std)]

use derive_more::Sum;

#[derive(Sum)]
struct MyInts(i32, i64);

// Add implementation is needed for Sum
impl ::core::ops::Add for MyInts {
    type Output = MyInts;
    #[inline]
    fn add(self, rhs: MyInts) -> MyInts {
        MyInts(self.0.add(rhs.0), self.1.add(rhs.1))
    }
}

#[derive(Sum)]
struct Point2D {
    x: i32,
    y: i32,
}

impl ::core::ops::Add for Point2D {
    type Output = Point2D;
    #[inline]
    fn add(self, rhs: Point2D) -> Point2D {
        Point2D {
            x: self.x.add(rhs.x),
            y: self.y.add(rhs.y),
        }
    }
}

[ Dauer der Verarbeitung: 0.36 Sekunden  ]