Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
0x182d4454fb211940 committed Aug 15, 2022
0 parents commit a529b95
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/target
/Cargo.lock
13 changes: 13 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[package]
name = "asrefmut"
version = "0.1.0"
authors = ["0x182d4454fb211940"]
edition = "2021"
description = "Trait which combines `AsRef` and `AsMut`"
readme = "README.md"
repository = "https://github.com/0x182d4454fb211940/asrefmut"
license = "MIT"
keywords = ["trait", "asref", "asmut", "nostd"]
categories = ["no-std"]

[dependencies]
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Adds the trait `AsRefMut<T>`, which is implemented for any type which implements `AsRef<T>` and `AsMut<T>`.
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
//! Adds the trait `AsRefMut<T>`, which is implemented for any type
//! which implements `AsRef<T>` and `AsMut<T>`.
/// Marker trait representing a type which implements `AsRef<T>` and `AsMut<T>`.
pub trait AsRefMut<T: ?Sized>: AsRef<T> + AsMut<T> {}

impl<Target: ?Sized + AsRef<T> + AsMut<T>, T: ?Sized> AsRefMut<T> for Target {}

0 comments on commit a529b95

Please sign in to comment.