Skip to content
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

Merged
merged 14 commits into from
Aug 24, 2020

Conversation

ryanlai2
Copy link
Contributor

@ryanlai2 ryanlai2 commented Aug 21, 2020

This sample showcases WinML using Squeezenet through the Rust WinRT projection. It utilizes Microsoft.AI.MachineLearning 1.4.0 Nuget package.

@ryanlai2 ryanlai2 requested a review from a team as a code owner August 21, 2020 02:12
@ryanlai2 ryanlai2 merged commit 3d2e468 into master Aug 24, 2020
@martinb35 martinb35 deleted the user/rylai/rust_project branch June 21, 2021 19:04
Copy link

@zhiburt zhiburt left a 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 {
Copy link

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,
Copy link

@zhiburt zhiburt Jun 24, 2021

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" {
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants