generated from xomrk/project-template-0.rs
RustStdlibStaticContext and Clone
This commit is contained in:
parent
3662443d32
commit
6b800e5e2d
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name =
|
name = "context-core-0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[lints.rust]
|
[lints.rust]
|
||||||
|
|||||||
3
src/clone.rs
Normal file
3
src/clone.rs
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
pub trait Ctx_Clone<T> {
|
||||||
|
fn clone(&mut self, image: &T) -> T;
|
||||||
|
}
|
||||||
@ -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;
|
||||||
10
src/rust_stdlib_static_context.rs
Normal file
10
src/rust_stdlib_static_context.rs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user