Re: [PATCH v2 1/2] device: rust: rename Device::as_ref() to Device::from_raw()

2025-07-16 Thread Danilo Krummrich
On Fri Jul 11, 2025 at 10:04 AM CEST, Alice Ryhl wrote: > The prefix as_* should not be used for a constructor. Constructors > usually use the prefix from_* instead. > > Some prior art in the stdlib: Box::from_raw, CString::from_raw, > Rc::from_raw, Arc::from_raw, Waker::from_raw, File::from_raw_fd

Re: [PATCH v2 1/2] device: rust: rename Device::as_ref() to Device::from_raw()

2025-07-16 Thread Greg Kroah-Hartman
On Fri, Jul 11, 2025 at 08:04:37AM +, Alice Ryhl wrote: > The prefix as_* should not be used for a constructor. Constructors > usually use the prefix from_* instead. > > Some prior art in the stdlib: Box::from_raw, CString::from_raw, > Rc::from_raw, Arc::from_raw, Waker::from_raw, File::from_r

Re: [PATCH v2 1/2] device: rust: rename Device::as_ref() to Device::from_raw()

2025-07-14 Thread Danilo Krummrich
On Fri Jul 11, 2025 at 10:04 AM CEST, Alice Ryhl wrote: > The prefix as_* should not be used for a constructor. Constructors > usually use the prefix from_* instead. > > Some prior art in the stdlib: Box::from_raw, CString::from_raw, > Rc::from_raw, Arc::from_raw, Waker::from_raw, File::from_raw_fd

Re: [PATCH v2 1/2] device: rust: rename Device::as_ref() to Device::from_raw()

2025-07-11 Thread Benno Lossin
On Fri Jul 11, 2025 at 10:04 AM CEST, Alice Ryhl wrote: > The prefix as_* should not be used for a constructor. Constructors > usually use the prefix from_* instead. > > Some prior art in the stdlib: Box::from_raw, CString::from_raw, > Rc::from_raw, Arc::from_raw, Waker::from_raw, File::from_raw_fd

[PATCH v2 1/2] device: rust: rename Device::as_ref() to Device::from_raw()

2025-07-11 Thread Alice Ryhl
The prefix as_* should not be used for a constructor. Constructors usually use the prefix from_* instead. Some prior art in the stdlib: Box::from_raw, CString::from_raw, Rc::from_raw, Arc::from_raw, Waker::from_raw, File::from_raw_fd. There is also prior art in the kernel crate: cpufreq::Policy::