-
Notifications
You must be signed in to change notification settings - Fork 445
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
Check in sample showcasing Rust projection of Winrt #342
Conversation
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.
I've run into this issue from you link on rust-lang/cargo#5305.
I would say you did a good job bypassing this 👍 for binaries even though it seems don't work for libraries.
And accidentally just left a subtle review comments 😄
PS: I know that it meaningless but as I went through code anyway I decided to left it.
@@ -0,0 +1,35 @@ | |||
macro_rules! copy_file { |
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.
Isn't it can be a function rather then macro?
@@ -0,0 +1,35 @@ | |||
macro_rules! copy_file { | |||
($file:expr, $destination:expr) => { | |||
match fs::copy($file, |
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.
Here's an issue with not fully qualified fs::copy
call.
You rely here on use std::fs;
which you're doing in copy_resources()
.
fn copy_resources() { | ||
use std::fs; | ||
let profile = std::env::var("PROFILE").unwrap(); | ||
if profile == "debug" { |
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.
I was wondering if this can be checked at compile time and it is actually.
https://doc.rust-lang.org/reference/conditional-compilation.html#debug_assertions can be used to check if it's a dev or release profile.
This sample showcases WinML using Squeezenet through the Rust WinRT projection. It utilizes Microsoft.AI.MachineLearning 1.4.0 Nuget package.