diff options
Diffstat (limited to 'azalea-core/src')
| -rwxr-xr-x | azalea-core/src/position.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/azalea-core/src/position.rs b/azalea-core/src/position.rs index e9864035..369607c5 100755 --- a/azalea-core/src/position.rs +++ b/azalea-core/src/position.rs @@ -186,6 +186,25 @@ macro_rules! vec3_impl { } } } + + impl From<($type, $type, $type)> for $name { + #[inline] + fn from(pos: ($type, $type, $type)) -> Self { + Self::new(pos.0, pos.1, pos.2) + } + } + impl From<&($type, $type, $type)> for $name { + #[inline] + fn from(pos: &($type, $type, $type)) -> Self { + Self::new(pos.0, pos.1, pos.2) + } + } + impl From<$name> for ($type, $type, $type) { + #[inline] + fn from(pos: $name) -> Self { + (pos.x, pos.y, pos.z) + } + } }; } |
