mirror of
https://codeberg.org/icewind/vbsp.git
synced 2026-06-03 18:54:05 +02:00
cleaner vector iter
This commit is contained in:
parent
3cdb50636d
commit
02d22a42f7
2 changed files with 2 additions and 3 deletions
|
|
@ -6,7 +6,7 @@ homepage = "https://github.com/icewind1991/vbsp"
|
||||||
repository = "https://github.com/icewind1991/vbsp"
|
repository = "https://github.com/icewind1991/vbsp"
|
||||||
description = "Rust parser for valve bsp files."
|
description = "Rust parser for valve bsp files."
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
edition = "2018"
|
edition = "2021"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,6 @@ use bitflags::bitflags;
|
||||||
use bv::BitVec;
|
use bv::BitVec;
|
||||||
use parse_display::Display;
|
use parse_display::Display;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
use std::iter::once;
|
|
||||||
use std::mem::size_of;
|
use std::mem::size_of;
|
||||||
use std::ops::{Add, Index};
|
use std::ops::{Add, Index};
|
||||||
|
|
||||||
|
|
@ -210,7 +209,7 @@ pub struct Vector {
|
||||||
|
|
||||||
impl Vector {
|
impl Vector {
|
||||||
pub fn iter(&self) -> impl Iterator<Item = f32> {
|
pub fn iter(&self) -> impl Iterator<Item = f32> {
|
||||||
once(self.x).chain(once(self.y)).chain(once(self.z))
|
[self.x, self.y, self.z].into_iter()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue