Code Monkey home page Code Monkey logo

learning-rust.github.io's People

Contributors

briankung avatar cwalv avatar devnoname120 avatar dkm avatar dschuyler avatar dumindu avatar elementh avatar evokelektrique avatar fatahnuram avatar goriunov avatar icyjoseph avatar jay-em17 avatar johnnyasantoss avatar jschatz1 avatar kennyoliver avatar kweaver87 avatar longshorej avatar manuelmauro avatar montanaflynn avatar mscherer avatar nwatx avatar pakoito avatar psbrandt avatar qidanw avatar qstorey avatar spacewhite avatar vks avatar wdecoster avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

learning-rust.github.io's Issues

Vector: Creating empty vectors returns an error

In the very first example in the Vectors chapter

let mut a = Vec::new(); //1.With new() keyword
let mut b = vec![]; //2.Using the vec! macro

when I compile just these statements I get an error saying

error[E0282]: type annotations needed
  --> a.rs:19:15
   |
19 |     let mut bv = vec![]; //2.Using the vec! macro
   |         ------   ^^^^^^ cannot infer type for `T`
   |         |
   |         consider giving `bv` a type
   |
   = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)

Shouldn't this be documented in the guide?

Code blocks for multiple files is confusing

It's just an opinion but, I think, the formula for showing multiple files in one code block makes it really confusing to read. It would be much better for multiple files to use multiple code blocks.

This is what we have now.

// 01. greetings/Cargo.toml to mark as a workspace and to add members
[workspace]
members = [
    "lib",
    "examples/hello"
]

// 02.1 greetings/lib/Cargo.toml to change the package name to greetings
[package]
name = "greetings"
version = "0.1.0"
authors = ["Dumindu Madunuwan"]

[dependencies]

It would be better like this.

greetings/Cargo.toml to mark as a workspace and to add members

[workspace]
members = [
    "lib",
    "examples/hello"
]

greetings/lib/Cargo.toml to change the package name to greetings

[package]
name = "greetings"
version = "0.1.0"
authors = ["Dumindu Madunuwan"]

[dependencies]

Confusing isize/usize description

I'm not sure to understand exactly what this means :

Simply this is the data type to cover all unsigned integer types but memory allocates according to the
size of a pointer. Min and max values are similar to u64.

I guess these types are similar to C's [s]size_t used for storing objects size (usually 32bits on 32bits platform and 64bits on 64bits platforms).

Syntax error

I guess that in the binding of variable d in arrays you wanted to use = instead of :. As of Rust 1.23.0 this is an error.

Consider rewording of comparable language reference for interface trait comparison

Referencing Java interfaces as a comparison to traits then right after making a "but" traits can have default method impls may cause some confusion for Java developers https://github.com/learning-rust/site/blob/master/source/docs/b5.impls_and_traits.md

The reason being that Java interfaces can also have default method impls https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html.

I'm suggesting the change because I'm offering this content up to my company of mostly Java/Scala developers as onboarding material for learning rust.

Suggestions to improve this website.

I like how it is well polished. However I wish there it was more interactive, like CodeCadmey and Khan Academy.

Take a look at how it explains how to do programming
https://www.khanacademy.org/computing/computer-programming/programming/drawing-basics/pt/drawing-more-shapes-with-code

In this link, it is an interactive video, meaning that you can change code inside the video so you can experiment.

https://www.khanacademy.org/computing/computer-programming/programming/drawing-basics/pc/challenge-simple-snowman
In this link I like how they give you an interactive exercise, and I wish to see that in Rust as well.

Primitive Data Types: reference to IEEE floating-point standard in integers section

I'm confused

  • In section "i8, i16, i32, i64, i128":

    Min and max values are based on IEEE standard for Binary Floating-Point Arithmetic.

  • In section "u8, u16, u32, u64, u128":

    Same as signed numbers, min and max values are based on IEEE standard for Binary Floating-Point Arithmetic.

Does "IEEE standard for Binary Floating-Point Arithmetic" means IEEE 754? I think it doesn't specify integer numbers. It even says in section "2. Definitions, abbreviations, and acronyms ":

2.1.32 integer format: A format not defined in this standard that represents a subset of the integers and perhaps additional values representing infinities, NaNs, or negative zeros.

The unwrap_or* Error Handling Examples Need Improvement

This page is the first or second google result for "rust unwrap_or_else example": https://learning-rust.github.io/docs/e4.unwrap_and_expect.html#unwrap-or-unwrap-or-default-and-unwrap-or-else

It takes longer than should be necessary to look at this pile of asserts and 1-2 character variable names and figure out the meaning. Having real examples would help a lot. The closure definitions in the unwrap_or_else example are particularly unhelpful as they don't include passing parameters to the closure, they're so short it makes it hard to think of them as anonymous functions, and they also aren't written in-line which is how they'll often be used.

Something like this is considerably more useful: https://gist.github.com/csknk/68b3d87bc76ce8c3431145fc0cc2fd3d

Responsive issue on wide screen

There is some responsive issue when the window is larger than 2560px.
If you don't have a wide screen, you can debug that with the "simulator mode" at 50% scale.

2023-11-26_05-52-45.mp4

Maybe a misspell?

There is a confusing expression in the lower half of the section about vector, "No of elements". What does the sentence mean? "Num of the elements" ?

Question regarding a section in lifetimes

Hello,

Thanks everyone for this amazing resource for learning rust. I have a question regarding a section in lifetime section.

Lifetime annotations are checked at compile-time. Compiler checks when a data is used for the first and the last times. According to that, Rust manages memory in run time. This is the major reason for slower compilation times in Rust.

was this suppose to say Rust manages memory at compile time ... and not ...in run time... based on the context of the statement?

camelCase is wrongly represented as CamelCame

In the guides,
You mistakenly suggest throughout the pages that things should be named using CamelCase notation.

But it is wrongly represented, the correct names should be:

camelCase: lower case for first word, Capital for initial of following words.
PascalCase: Initial for all words should be uppercase.
snake_case: compound word separated by underscore

Despite that, the docs are really good, thanks to put it together.

Site CSS makes it less usable on ultrawide monitors

Hey, great resource you have here! But there's some weird stuff done in the CSS that makes things go absolutely goofy on ultrawide monitors.

It looks like the developer tested the styles for ultrawide monitors like this.

image

And that seems fine, but when that's actually on my monitor, it looks like this.

image

The font size that is in my URL bar, or in the dev tools, or on the tab are perfectly optimal for reading.

I actually have to shrink the screen to make it readable, like this.

image

It looks like the problem is this file. Removing that and the reference here would fix the problem. I really think that users can be trusted to adjust their scaling to what's comfortable to them.

Text improvements to "Rust Basics"

Rust beginner here, coming from Python.

I'm noticing some parts of the text that either have some language errors or could do with clarification. Since my main intention today is to learn some Rust, I'm not creating PRs to fix them all now, but instead gathering them here and then either I or maybe someone else can go through them later.

Updating as I go:

  • Basics -> Cargo: "But mainly it uses for," is an odd rather empty sentence. The following bullet points don't really fit in with the idea of a package manager either. I'm familiar with package managers that let me download and install software others have written (i.e. matplotlib). This section appears to be concerned with creating projects to share with others? Maybe that should be moved to after the reader has downloaded some packages?

  • Basics -> Comments: "Never use block comments" does not teach me why not. What is the difference between module and crate level documentation? Maybe move the latter discussion to later rather than confuse now?

How can I contribute a chinese version?

Hi,
I am a developer who is learning the Rust recently. I've read some books about Rust, and I feel this site is a good tool. I noticed that there is a language switcher at the top of the page, but English is the only option, for now.

I want to add a Chinese version of these docs and I need to know how can I do that :)

No issues. I just want to say thank you for making this.

Hi, I have no issues as of the moment but I just wanted to say thank you for making this. It's a really valuable resource. Maybe in the future, I'll have something to contribute. Anyway I just wanted to know that what you made is really valuable. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.