-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplified conditional compilation #138
Changes from 3 commits
6afd0e3
16e5ea0
d534a39
d6a2806
e9e83b0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
use crate::windows_native::descriptor::typedefs::{Caps, LinkCollectionNode}; | ||
use crate::windows_native::descriptor::types::{ItemNodeType, Items, MainItemNode, MainItems}; | ||
use crate::windows_native::error::{WinError, WinResult}; | ||
use crate::windows_native::utils::PeakIterExt; | ||
use super::typedefs::{Caps, LinkCollectionNode}; | ||
use super::types::{ItemNodeType, Items, MainItemNode, MainItems}; | ||
use super::super::error::{WinError, WinResult}; | ||
use super::super::utils::PeakIterExt; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am not really a fan of relative paths for imports, when its necessary to go up multiple levels. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I made this change to keep the backend more self-contained and not depend on the name it was imported under. My original idea was to do something like this: #[cfg_attr(feature = "linux-native", path = "linux_native.rs")]
#[cfg_attr(feature = "windows-native", path = "windows_native/mod.rs")]
mod platform; Which obviously broke those imports. After changing my approach to |
||
|
||
pub fn encode_descriptor(main_item_list: &[MainItemNode], caps_list: &[Caps], link_collection_nodes: &[LinkCollectionNode]) -> WinResult<Vec<u8>> { | ||
// *********************************** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why comment out these cfg_attrs, and not the ones below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The attribute is used to document that a certain function is limited to certain configurations:
The native backends should not appear to the public api and therefore the attribute seemed pretty useless. However I just commented them out for now to make it easier to reenable them in case I am wrong and they did actually serve a purpose that I missed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I think you are right. We can just remove them completely, since its backend code.