| Crates.io | no-copy |
| lib.rs | no-copy |
| version | 0.1.2 |
| created_at | 2025-08-13 14:52:24.412172+00 |
| updated_at | 2026-01-16 16:31:32.202409+00 |
| description | A simple packer, but no implement copy |
| homepage | |
| repository | https://github.com/A4-Tacks/no-copy-rs |
| max_upload_size | |
| id | 1793693 |
| size | 11,616 |
A simple packer, but no implement copy
This crate originates from the behavior of non move closures when capturing Copy types
let value;
{
let n = 2;
value = || n+1;
}
assert_eq!(value(), 3);
Imagine that it will compile? Actually, it won't
For non move closures, if owned uses a copy types value, it will actually capture the reference
Use NoCopy to make n no longer a copy types, compile passed:
let value;
{
let n = no_copy::NoCopy(2);
value = || n+1;
}
assert_eq!(value(), 3);