RustStdlibStaticContext and Clone

This commit is contained in:
Andrew Golovashevich 2025-03-20 18:19:44 +03:00
parent 3662443d32
commit 6b800e5e2d
4 changed files with 21 additions and 2 deletions

View File

@ -1,5 +1,5 @@
[package]
name =
name = "context-core-0"
edition = "2024"
[lints.rust]

3
src/clone.rs Normal file
View File

@ -0,0 +1,3 @@
pub trait Ctx_Clone<T> {
fn clone(&mut self, image: &T) -> T;
}

View File

@ -1 +1,7 @@
#![no_std]
#![no_std]
mod rust_stdlib_static_context;
mod clone;
pub use clone::Ctx_Clone;
pub use rust_stdlib_static_context::RustStdlibStaticContext;

View File

@ -0,0 +1,10 @@
use crate::Ctx_Clone;
#[derive(Default)]
pub struct RustStdlibStaticContext {}
impl<T: Copy> Ctx_Clone<T> for RustStdlibStaticContext {
fn clone(&mut self, image: &T) -> T {
return *image;
}
}