jsoverson / node-to-rust Goto Github PK
View Code? Open in Web Editor NEWLicense: Other
License: Other
Day 9:
Is there a reason why the method https://github.com/vinodotdev/node-to-rust/blob/4ba560485704f543306e50395a17638284934b45/src/crates/day-9/structs/src/main.rs#L29 is not used anywhere in that code?
As mentioned in the section on Adding CLI Arguments
cargo run -p cli -- --help
wasm-runner 0.1.0
Sample project from https://vino.dev/blog/node-to-rust-day-1-rustup/
USAGE:
cli
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
use my_lib::Module;
use structopt::{clap::AppSettings, StructOpt};
#[macro_use]
extern crate log;
#[derive(StructOpt)]
#[structopt(
name = "wasm-runner",
about = "Sample project from https://vino.dev/blog/node-to-rust-day-1-rustup/",
global_settings(&[
AppSettings::ColoredHelp
]),
)]
struct CliOptions {}
fn main() {
env_logger::init();
debug!("Initialized logger");
match Module::from_file("./module.wasm") {
Ok(_) => {
info!("Module loaded");
}
Err(e) => {
error!("Module failed to load: {}", e);
}
}
}
Now when we run our cli we see… nothing at all.
I just want to thank you for your series mate !
Great read, keep it up.
🥇
hello, @jsoverson ,
Thank you for providing us with such a good ebook for learning Rust. I want Rust enthusiasts in China to also learn this ebook. Can I fork this repo and translate it into Chinese?
thanks
Hi, this error will be easy for ruby developers but I'm not a ruby developer and I can't solve it although investigating in google. That's the error:
$ make deps
bundle install
/opt/homebrew/opt/ruby/bin/bundle:25:in `load': cannot load such file -- /opt/homebrew/Cellar/ruby/3.3.0/lib/ruby/gems/3.3.0/gems/bundler-2.5.7/exe/bundle (LoadError)
from /opt/homebrew/opt/ruby/bin/bundle:25:in `<main>'
make: *** [deps] Error 1
How can I solve that? Thanks.
When describing the solution for getState
, initially the implementation pub fn get_state(&self) -> &String
is given along with a usefull explanation which matches the struct types.
But for the "full code" implementation immediately following, it changes to pub fn get_state(&self) -> &str
which I found confusing since the distinction between them is not covered and the apparent String -> &str
"cohersion" in the second version is not made clear inline.
let closure = () \=> {
console.log("Hi! I'm in a closure");
};
closure();
has weird \=>
for some reason and it's appear all over the book.
Not sure what it was. You can assign to me if it's a bug I will take a look.
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.