Merge pull request #91 from nvzqz/const-all-the-things

Make many functions `const`
This commit is contained in:
Héctor Ramón 2020-03-06 03:47:40 +01:00 committed by GitHub
commit d817fe8e14
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View file

@ -12,7 +12,7 @@ impl Node {
///
/// [`Node`]: struct.Node.html
/// [`Size`]: ../struct.Size.html
pub fn new(size: Size) -> Self {
pub const fn new(size: Size) -> Self {
Self::with_children(size, Vec::new())
}
@ -20,7 +20,7 @@ impl Node {
///
/// [`Node`]: struct.Node.html
/// [`Size`]: ../struct.Size.html
pub fn with_children(size: Size, children: Vec<Node>) -> Self {
pub const fn with_children(size: Size, children: Vec<Node>) -> Self {
Node {
bounds: Rectangle {
x: 0.0,