From 354bc0599fc846e62a621f46ed4e4f10abc5bbd2 Mon Sep 17 00:00:00 2001 From: Firestar99 <4696087-firestar99@users.noreply.gitlab.com> Date: Tue, 12 Sep 2023 12:50:38 +0200 Subject: [PATCH 1/2] fixed Buffer::new* docs still referring to buffer_info instead of create_info --- vulkano/src/buffer/mod.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/vulkano/src/buffer/mod.rs b/vulkano/src/buffer/mod.rs index efba5370a7..aa82f64a19 100644 --- a/vulkano/src/buffer/mod.rs +++ b/vulkano/src/buffer/mod.rs @@ -305,7 +305,7 @@ impl Buffer { /// /// # Panics /// - /// - Panics if `buffer_info.size` is not zero. + /// - Panics if `create_info.size` is not zero. pub fn new_sized( allocator: Arc, create_info: BufferCreateInfo, @@ -330,7 +330,7 @@ impl Buffer { /// /// # Panics /// - /// - Panics if `buffer_info.size` is not zero. + /// - Panics if `create_info.size` is not zero. /// - Panics if `len` is zero. pub fn new_slice( allocator: Arc, @@ -349,7 +349,7 @@ impl Buffer { /// /// # Panics /// - /// - Panics if `buffer_info.size` is not zero. + /// - Panics if `create_info.size` is not zero. /// - Panics if `len` is zero. pub fn new_unsized( allocator: Arc, @@ -376,7 +376,7 @@ impl Buffer { /// /// # Panics /// - /// - Panics if `buffer_info.size` is not zero. + /// - Panics if `create_info.size` is not zero. /// - Panics if `layout.alignment()` is greater than 64. pub fn new( allocator: Arc, @@ -388,11 +388,7 @@ impl Buffer { // TODO: Enable once sparse binding materializes // assert!(!allocate_info.flags.contains(BufferCreateFlags::SPARSE_BINDING)); - assert!( - create_info.size == 0, - "`Buffer::new*` functions set the `buffer_info.size` field themselves, you should not \ - set it yourself", - ); + assert_eq!(create_info.size, 0, "`Buffer::new*` functions set the `create_info.size` field themselves, you should not set it yourself"); create_info.size = layout.size(); From 907be2b89711da597ef7392a888c9564bc5e6063 Mon Sep 17 00:00:00 2001 From: Firestar99 <4696087-firestar99@users.noreply.gitlab.com> Date: Thu, 14 Sep 2023 13:07:00 +0200 Subject: [PATCH 2/2] fixed line length --- vulkano/src/buffer/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/vulkano/src/buffer/mod.rs b/vulkano/src/buffer/mod.rs index aa82f64a19..5b4605e693 100644 --- a/vulkano/src/buffer/mod.rs +++ b/vulkano/src/buffer/mod.rs @@ -388,7 +388,11 @@ impl Buffer { // TODO: Enable once sparse binding materializes // assert!(!allocate_info.flags.contains(BufferCreateFlags::SPARSE_BINDING)); - assert_eq!(create_info.size, 0, "`Buffer::new*` functions set the `create_info.size` field themselves, you should not set it yourself"); + assert_eq!( + create_info.size, 0, + "`Buffer::new*` functions set the `create_info.size` field themselves, you should not \ + set it yourself" + ); create_info.size = layout.size();