diff --git a/.codespellrc b/.codespellrc new file mode 100644 index 0000000..cd6c520 --- /dev/null +++ b/.codespellrc @@ -0,0 +1,7 @@ +[codespell] +# Ref: https://github.com/codespell-project/codespell#using-a-config-file +skip = .git*,*.svg,.codespellrc,*.html +check-hidden = true +# Some case sensitive names and too long "words" without spaces (usually some encodings) +ignore-regex = \b(Carin|Shure)\b|[^ \t]{50,} +ignore-words-list = crate diff --git a/.github/workflows/codespell.yml b/.github/workflows/codespell.yml new file mode 100644 index 0000000..c59e047 --- /dev/null +++ b/.github/workflows/codespell.yml @@ -0,0 +1,25 @@ +# Codespell configuration is within .codespellrc +--- +name: Codespell + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +jobs: + codespell: + name: Check for spelling errors + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Annotate locations with typos + uses: codespell-project/codespell-problem-matcher@v1 + - name: Codespell + uses: codespell-project/actions-codespell@v2 diff --git a/CONTRIBUTION.md b/CONTRIBUTION.md index 91a4446..8cd3244 100644 --- a/CONTRIBUTION.md +++ b/CONTRIBUTION.md @@ -1,5 +1,5 @@ # Translations -I would be DELIGHTED to recieve translations, in any order, don't feel you have to start from the start! Please give me a PR (based on your forked repo) and use this heirachy: `/scripts/translations/fr/xx-your-translation-here.md` +I would be DELIGHTED to receive translations, in any order, don't feel you have to start from the start! Please give me a PR (based on your forked repo) and use this hierarchy: `/scripts/translations/fr/xx-your-translation-here.md` Thank you! diff --git a/scripts/01-rust-your-code-can-be-perfect.md b/scripts/01-rust-your-code-can-be-perfect.md index 9400243..eecec8f 100644 --- a/scripts/01-rust-your-code-can-be-perfect.md +++ b/scripts/01-rust-your-code-can-be-perfect.md @@ -142,10 +142,10 @@ We're here to talk about making perfect software. I'm TIRED of trawling error logs for it to tell me: - `"unexpected ; in query"`, or - `json decoding error on line 1` -- `NullPointerException` (or `NoneType has no atribute`) +- `NullPointerException` (or `NoneType has no attribute`) notes: -I've been searching for many years for systems, frameworks and methods to make my code more reliable, or guarenteed. +I've been searching for many years for systems, frameworks and methods to make my code more reliable, or guaranteed. We as developers accept that our lives are governed by errors. Often bullshit errors like these. @@ -304,7 +304,7 @@ This may be a new way of programming for you, but it's such a good pattern that notes: Rust has a best-in-class package manager, solving all the dependency nightmares we face day-to-day. -This is what you get when you have a community focussed on corectness. +This is what you get when you have a community focussed on correctness. --- @@ -404,7 +404,7 @@ Lets reason about this short piece of code. It's still using the Rocket web framework, by the way, think of it as an Express, Sinatra, or Flask equivalent. -If our program compiles we know many things are guarenteed: +If our program compiles we know many things are guaranteed: - `id` will be a valid UUID, from a valid http path - The return json will ALWAYS be in the schema we designed, named FormResponse, with defined values acting as the contract we can never break with our API clients. - sqlx actually runs that query on my local dev database with a valid test input (generated on the type) in a rolled-back transaction at compile time. If it is invalid, my code doesn't compile. diff --git a/scripts/04-rust-impatient.md b/scripts/04-rust-impatient.md index f00df6f..bd97592 100644 --- a/scripts/04-rust-impatient.md +++ b/scripts/04-rust-impatient.md @@ -220,7 +220,7 @@ The semi-colon marks the end of a statement. notes: The semi-colon marks the end of a statement. -Unlike in other langauges, semicolons are not just mandatory whitespace. +Unlike in other languages, semicolons are not just mandatory whitespace. --- diff --git a/scripts/05-stop-writing-rust.md b/scripts/05-stop-writing-rust.md index 0321017..c882b50 100644 --- a/scripts/05-stop-writing-rust.md +++ b/scripts/05-stop-writing-rust.md @@ -151,7 +151,7 @@ Backwards compatibility and correctness. notes: In previous videos I said that there will be no Rust 2.0 due to the macro system. Now, I talked with a Rust maintainer, and they said this actually misses the point: -Code written today will be compileable in 5, 10, 40 years because of the Rust team's commitment to perfect backwards compatibility. +Code written today will be compilable in 5, 10, 40 years because of the Rust team's commitment to perfect backwards compatibility. Code you write today, will always compile in all future versions of rust. The side effect of this is that code you build today benefits from ALL FUTURE OPTIMISATIONS that the rust toolchain will receive. With no modification by you, your build times and deployed code will get FASTER. @@ -273,7 +273,7 @@ notes: You can either quickly tell the compiler that you KNOW the result might be a failure, and use .unwrap(), just to get something working now, optionally enriching the crash with an error message with .expect(), or you can handle the error comprehensively. When writing rust, .unwrap() is for prototyping code, so we don't have the annoyance of heavyweight error handling when we just want to get going. -This is why most code exmaples you will see use .unwrap(). +This is why most code examples you will see use .unwrap(). They're not trying to teach you error handling, they're just showing you how to open a file. In other languages these kinds of runtime pitfalls are hidden, at best by an exception that you have to catch, or worst, with no visible indication that the code may crash at all. @@ -346,7 +346,7 @@ I will talk about three. ``` ```rust - > "javscript" + > "javascript" ``` ```rust @@ -451,7 +451,7 @@ It's not just possible to write perfect safe code with Rust. It's actually easy. --- -## WERID ANALOGY TIME +## WEIRD ANALOGY TIME notes: Let me finish with a real-life analogy of what it feels like to me to deploy Rust diff --git a/scripts/11-Rust-Makes-Cents.md b/scripts/11-Rust-Makes-Cents.md index ebdd57d..2c71f21 100644 --- a/scripts/11-Rust-Makes-Cents.md +++ b/scripts/11-Rust-Makes-Cents.md @@ -295,7 +295,7 @@ async fn main() -> Result<(), Error> { --- -## Lambda Http Hander +## Lambda Http Handler ```toml lambda_http = "0.6.1" @@ -317,7 +317,7 @@ notes: Here is an http hello world lambda handler in Rust using the official aws sdk, which contains all functions and types for interacting with the aws cloud. -This compiles, the comipler throws up no errors, which means we can be confident about a lot of things without any extra testing. +This compiles, the compiler throws up no errors, which means we can be confident about a lot of things without any extra testing. --- @@ -564,7 +564,7 @@ def fib(n: int) -> Iterator[int]: notes: In fact the opposite is true. -The larger and more complex your codebase is the more guarantees you want to build-in to your compilers your linter, and your tests. +The larger and more complex your codebase is the more guarantees you want to built-in to your compilers your linter, and your tests. Everyone loves typescript (almost as much as they love rust) and with good reason. It has some of the syntax that javascript is missing that developers are crying out for. and the python world is slowly embracing static typing, since type annotations were added in Python 3. diff --git a/scripts/12-webgl-rust-wasm.md b/scripts/12-webgl-rust-wasm.md index 8d625e0..6c32620 100644 --- a/scripts/12-webgl-rust-wasm.md +++ b/scripts/12-webgl-rust-wasm.md @@ -212,7 +212,7 @@ And when we stop thinking about 'web apps' as 'web pages' and start thinking of notes: -Every week we hear about new, faster javascript frameworks coming out, offering more and more dom manipulations per second. Svelt compared to React, for instance. +Every week we hear about new, faster javascript frameworks coming out, offering more and more dom manipulations per second. Svelte compared to React, for instance. They're useful for a DOM-constrained app, but we have access to native UI speeds, no latency, and 60fps with webgl. diff --git a/scripts/16-rust-testing.md b/scripts/16-rust-testing.md index 401a655..a25ae74 100644 --- a/scripts/16-rust-testing.md +++ b/scripts/16-rust-testing.md @@ -89,7 +89,7 @@ For the remainder of the bugs that ARE possible to express, you will indeed need | Happy Path | Comprehensive | Probabilistic | | ------------ | ------------- | ------------- | -| Assertations | Black Box | QuickCheck | +| Assertions | Black Box | QuickCheck | | Doctests | White Box | Proptest | | Examples | | Fuzzing | @@ -497,7 +497,7 @@ def hello(name): ``` notes: -Probabalistic testing is a great way to shine a light into the dusty corners of our app that we may have forgotten about. +Probabilistic testing is a great way to shine a light into the dusty corners of our app that we may have forgotten about. However, in other languages, it often requires boilerplate code. diff --git a/scripts/17-ai-the-second-renaissance.md b/scripts/17-ai-the-second-renaissance.md index 4a86097..8016381 100644 --- a/scripts/17-ai-the-second-renaissance.md +++ b/scripts/17-ai-the-second-renaissance.md @@ -135,7 +135,7 @@ notes: The first coffeehouses in [Constantinople](https://en.wikipedia.org/wiki/Constantinople "Constantinople") were opened in 1475 -While better historians than me will tell you the myriad causes of the European Rennaisance, the factor that I really like is that it happened just after Europeans stopped daydrinking beer as their only safe option. +While better historians than me will tell you the myriad causes of the European Renaissance, the factor that I really like is that it happened just after Europeans stopped daydrinking beer as their only safe option. --- diff --git a/scripts/18-rusts-magic-macros.md b/scripts/18-rusts-magic-macros.md index 882697d..baaa4d3 100644 --- a/scripts/18-rusts-magic-macros.md +++ b/scripts/18-rusts-magic-macros.md @@ -481,7 +481,7 @@ Let's look at compile-time execution. --- -# Arbitary Compile-time Execution +# Arbitrary Compile-time Execution ```rust[] // let mut conn = ; @@ -506,7 +506,7 @@ Though it has normal functions for querying the database, it also has the query! At runtime, this is just the same as any other string-based sql querying library. It sends that string query along to the db through the connection. -But at compiletime, the query!() macro does some magic. +But at compile time, the query!() macro does some magic. SQLx leverages the power of Rust's macros AND rich type system to fill in the string query with test data and execute it on your local dev database at compile time. diff --git a/scripts/19-av.md b/scripts/19-av.md index 1529655..79073eb 100644 --- a/scripts/19-av.md +++ b/scripts/19-av.md @@ -459,7 +459,7 @@ I'm editing this audio and video right now in reaper, in addition to being the b Reaper is not open source, but before that puts you off let me redeem it with two facts: -One, linux is natively supported, alongside the usual suspects of windows and osx, but it feels like the reaper developers REALLY care about linux support, it works on raspberry pi and even on the new M1 mac hardware, runnin on asahi linux. +One, linux is natively supported, alongside the usual suspects of windows and osx, but it feels like the reaper developers REALLY care about linux support, it works on raspberry pi and even on the new M1 mac hardware, running on asahi linux. The second reason is sentimental. It's built by who made among other things: diff --git a/scripts/20-rust-userland.md b/scripts/20-rust-userland.md index cda56d6..b6a7776 100644 --- a/scripts/20-rust-userland.md +++ b/scripts/20-rust-userland.md @@ -108,7 +108,7 @@ sccache re-uses already-compiled artifices to skip redundant compilation. and in When you're installing system tools that very often are built by people that always use the stable version of a dependency, you might unnecessarily re-compile that dependency very often. -With sccache, you wont. +With sccache, you won't. --- @@ -145,7 +145,7 @@ Nu is a shell built around the language of the same name. --- -## Nu's Structured Pipelins +## Nu's Structured Pipelines ![[nu-post-httpbin.png]] notes: @@ -366,7 +366,7 @@ notes: > Bob is a cross-platform and easy-to-use Neovim version manager, allowing for switching between versions right from the command line. -I found it after discovering that the ubuntu repos did not have neovim verion 0.8, which is the minimum version that my preferred distribution, astronvim, supports. +I found it after discovering that the ubuntu repos did not have neovim version 0.8, which is the minimum version that my preferred distribution, astronvim, supports. Though the neovim team build comprehensive packages and installers for every system, I try not to do in a web browser what I can do on the command line. A theme you will see more of today. diff --git a/scripts/22-starting-rust.md b/scripts/22-starting-rust.md index 9638d0f..254b595 100644 --- a/scripts/22-starting-rust.md +++ b/scripts/22-starting-rust.md @@ -425,7 +425,7 @@ Rust is flexible, and doesn't force you to write in a functional style. Haskell, notes: Have a look at either Learn You A Haskell or Real World Haskell or both. -Again, you can mostly read through these quickly. Your package manger will have the haskell repl, which is called GHCI, and any version it installs will be fine for experimentation. +Again, you can mostly read through these quickly. Your package manager will have the haskell repl, which is called GHCI, and any version it installs will be fine for experimentation. Learning Haskell will teach you about mapping, filtering, folding, currying, matching, and many other words to describe your algorithms in rust, which are abandoned in other languages that just use for loops and if statements. diff --git a/scripts/23-amateur-radio.md b/scripts/23-amateur-radio.md index a2a4ced..a2db2b6 100644 --- a/scripts/23-amateur-radio.md +++ b/scripts/23-amateur-radio.md @@ -115,7 +115,7 @@ notes: If you've heard of CB radio, and you're thinking "oh this sounds similar". You're getting there, but Amateur radio is so much more. -A short list of things you can do with amatuer radio include but are not limited to: +A short list of things you can do with amateur radio include but are not limited to: --- @@ -507,7 +507,7 @@ It's a clever idea, and one that Amateur Radio operators were experimenting with There are repeaters EVERYWHERE, no matter where you live. -In decending order of my youtube audience , here are the repeater maps for - +In descending order of my youtube audience , here are the repeater maps for - --- @@ -570,7 +570,7 @@ Wherever there are towns and cities there are repeaters! If you want access to this world, it's cheap and easy, but like driving a car, there's a test and a license. And just like driving a car it augments any outdoor activity you might want to do. -I've not even talked about the lower frequencies, where you can get worldwide propogation without using repeaters! +I've not even talked about the lower frequencies, where you can get worldwide propagation without using repeaters! --- @@ -619,7 +619,7 @@ notes: When you talk to someone on radio without a repeater, you are talking directly to them at the speed of light, from your microphone to their speaker, with no intermediaries. Using the right frequency and antenna, this can be local in your city, or transcontinental, bouncing off the atmosphere or ground. -This direct communication feels much more personal - your voice is being mixed with a radio carrier signal or similar and broadcast in an analogue signal, then the reciever reverses the process to demodulate your voice. +This direct communication feels much more personal - your voice is being mixed with a radio carrier signal or similar and broadcast in an analogue signal, then the receiver reverses the process to demodulate your voice. It's analogue all the way, no bits, no bytes. diff --git a/scripts/24-rust-data-modelling.md b/scripts/24-rust-data-modelling.md index bfc11dc..2c92cc5 100644 --- a/scripts/24-rust-data-modelling.md +++ b/scripts/24-rust-data-modelling.md @@ -755,7 +755,7 @@ notes: And here's our little state machine in action! -In other languages, we'd have to do a lot of testing to prove we'd written our arbitary if statements correctly, and not missed a case, or written unreachable cases. +In other languages, we'd have to do a lot of testing to prove we'd written our arbitrary if statements correctly, and not missed a case, or written unreachable cases. Gross. There are no edge cases here, I only have to scrutinise the match expression to ensure the business logic is implemented correctly, and when I need to change the states, perhaps in Super Mario 64, it's easy, and the compiler will tell us what match statements need updating. diff --git a/scripts/26-oxidise-your-infra-with-shuttle.md b/scripts/26-oxidise-your-infra-with-shuttle.md index 454a1c9..6aec71d 100644 --- a/scripts/26-oxidise-your-infra-with-shuttle.md +++ b/scripts/26-oxidise-your-infra-with-shuttle.md @@ -359,10 +359,10 @@ notes: Here's a simple rocket.rs demo of shuttle persist. -The persist struct that is passed in inside our MyState wrapper can load and save ANY serde serialisable struct trasparently. +The persist struct that is passed in inside our MyState wrapper can load and save ANY serde serialisable struct transparently. -Behind the scenes, shuttle have told me that this is implemented with a persistant docker volume attached to your project. -This is a genius simple persistance option for when managing a database is overkill. +Behind the scenes, shuttle have told me that this is implemented with a persistent docker volume attached to your project. +This is a genius simple persistence option for when managing a database is overkill. --- @@ -422,7 +422,7 @@ Support and community organising is over on their Discord, where I immediately f # Shuttle Launchpad A Rust course written by Stefan Baumgartner -(organiser of [Rust Linz](https://rust-linz.at/)) +(organiser of [Rust Lines](https://rust-linz.at/)) https://www.shuttle.rs/launchpad @@ -440,7 +440,7 @@ Axum + DB + Static files demo notes: -A hello world is all very well, but let's build something with persistance showing how to use the shuttle infrastructure from code principles. +A hello world is all very well, but let's build something with persistence showing how to use the shuttle infrastructure from code principles. --- diff --git a/scripts/27-coping-mechanisms.md b/scripts/27-coping-mechanisms.md index f4238b7..1ab1e11 100644 --- a/scripts/27-coping-mechanisms.md +++ b/scripts/27-coping-mechanisms.md @@ -375,7 +375,7 @@ HOWEVER negative emotions are not ENTIRELY un-useful! Remember that girl I mentioned earlier? You'll stay with her because you're minimising the negative emotions you're feeling. That's not good. -You're not a robot, I know, but throuhg practice you can choose what to feel, and what to notice. +You're not a robot, I know, but through practice you can choose what to feel, and what to notice. Notice the negatives, but feel the positives. You have to FOCUS. diff --git a/scripts/28-how-to-speak-basic-rust.md b/scripts/28-how-to-speak-basic-rust.md index 882a27f..dcd100a 100644 --- a/scripts/28-how-to-speak-basic-rust.md +++ b/scripts/28-how-to-speak-basic-rust.md @@ -547,7 +547,7 @@ The rust compiler doesn't need to treat threaded code as a special case to maint notes: -Read the erorr again, thank you! +Read the error again, thank you! --- diff --git a/scripts/30-poem.md b/scripts/30-poem.md index e092273..9d3e655 100644 --- a/scripts/30-poem.md +++ b/scripts/30-poem.md @@ -129,11 +129,11 @@ notes: So let's talk about what we're NOT going to be doing, with a counter example. web.py is one of the many gifts the late, great Aaron Swartz gave us. -It's elegant in its simplicity, but we are not building simple tools, today we are building guarenteed correct tools. +It's elegant in its simplicity, but we are not building simple tools, today we are building guaranteed correct tools. -Python, and by virtue, web.py can't give you these guarnetees, lots of things are just strings, and the language can't help you with compile time checking very much. +Python, and by virtue, web.py can't give you these guarantees, lots of things are just strings, and the language can't help you with compile time checking very much. -Luckly we have Rust. +Luckily we have Rust. --- @@ -446,7 +446,7 @@ Binding your database and rest interface together AT COMPILE TIME allows us to h This is a SUPER POWER: if you define your API in rust structs, the COMPILER will stop you from breaking the contract with your api clients. -Not only that, but if you don't see a PR where the structs change, your colleagues and collaborators havn't broken the contract EITHER. +Not only that, but if you don't see a PR where the structs change, your colleagues and collaborators haven't broken the contract EITHER. Huge! diff --git a/scripts/32-rust-is-written-in-rust.md b/scripts/32-rust-is-written-in-rust.md index 851d739..e17097f 100644 --- a/scripts/32-rust-is-written-in-rust.md +++ b/scripts/32-rust-is-written-in-rust.md @@ -690,7 +690,7 @@ let my_unit = Unit; ```rust[] enum Infallible {} -// compile error, no varients = can't instantiate +// compile error, no variants = can't instantiate let impossible = Infallible::no_varients_found; ``` diff --git a/scripts/34-Plain-Text-Team.md b/scripts/34-Plain-Text-Team.md index 0019616..758c66d 100644 --- a/scripts/34-Plain-Text-Team.md +++ b/scripts/34-Plain-Text-Team.md @@ -97,7 +97,7 @@ In the Odyssey, Odysseus (confusingly called Ulysses in English literature) had This was a well-understood problem in his world. Sailors would simply solve this by putting wax in their ears, so the sirens' tempting song wouldn't lure them to their deaths. -But Odysseus had a challenge: He WANTED to hear the Sirens' beautiful song. He certainly didn't want to drown, so he ordered his crew to tie him to the mast of the ship, and to ignore any of his pleas to let him go, until safety. +But Odysseus had a challenge: He WANTED to hear the Sirens' beautiful song. He certainly didn't want to drown, so he ordered his crew to tie him to the mast of the ship, and to ignore any of his please to let him go, until safety. This way, he was able to guard against future bad decisions he knew he would make by setting up a framework to control his future self. diff --git a/scripts/37-functional-rust.md b/scripts/37-functional-rust.md index 12e8faf..5b806ce 100644 --- a/scripts/37-functional-rust.md +++ b/scripts/37-functional-rust.md @@ -168,7 +168,7 @@ notes: I ADORE Haskell. In my 'how to learn rust' video, I recommended learning the basics to teach you functional programming quickly. -The language has many incredible features that give me similar confidence to using Formal Methods, and the one I'll hightlight today is functional purity, which is a term you might be familiar with. +The language has many incredible features that give me similar confidence to using Formal Methods, and the one I'll highlight today is functional purity, which is a term you might be familiar with. In Haskell, and maybe, kinda, Rust, it's a first-class feature. diff --git a/scripts/38-nixos.md b/scripts/38-nixos.md index f77d356..48df434 100644 --- a/scripts/38-nixos.md +++ b/scripts/38-nixos.md @@ -408,7 +408,7 @@ This can't happen to me any more. Or if it does, I roll back, keep working, and notes: -Here are the most important tips I've found along the way, through trial and error, as I have tumbled down the NixOS rabit hole. +Here are the most important tips I've found along the way, through trial and error, as I have tumbled down the NixOS rabbit hole. If you want me to teach you them personally, that is possible through my Patreon. @@ -529,7 +529,7 @@ Running the script opens my config in my editor, I use vim but you could just as After adding it into my package list, I save and quit vim, and the script then continues. - First, autoformatting the config with alejandra, - Then displaying a condensed git diff, reminding me what I've changed across my nix files, it's simple in this case, of course -- Then it kicks off a rebuild of my nixos config, throwing away most of stdout, I just don't care what's happening, as long as it's going fine - I've already tabbed back to what I was supposed to be doing before I fell down a system configuration rabit hole. +- Then it kicks off a rebuild of my nixos config, throwing away most of stdout, I just don't care what's happening, as long as it's going fine - I've already tabbed back to what I was supposed to be doing before I fell down a system configuration rabbit hole. - If successfully built, the config is then committed to git with the current generation's metadata as the commit message. - Here we just built generation 160 diff --git a/scripts/40-compiler-driven-development.md b/scripts/40-compiler-driven-development.md index c324fe8..1e8c780 100644 --- a/scripts/40-compiler-driven-development.md +++ b/scripts/40-compiler-driven-development.md @@ -108,7 +108,7 @@ impl ResponseState for Metadata {} notes: You may be familiar with repl-driven development, or the fast feedback of testing out your code in the browser with hot code reloading. -The compiler is faster than all these methods, but to be fair, and balenced, it's because it's doing less. +The compiler is faster than all these methods, but to be fair, and balanced, it's because it's doing less. Pure model code, the heart of the plumbing of your app, doesn't have to deal with rendering a UI, making network connections, or setting up databases - none of that unimportant boilerplate. And nor should you, at first. diff --git a/scripts/41-brainmade.md b/scripts/41-brainmade.md index 0473f70..df0ba0f 100644 --- a/scripts/41-brainmade.md +++ b/scripts/41-brainmade.md @@ -106,7 +106,7 @@ When (not if) ethical models are built, and powered by 100% solar power, notes: Though these days I'm a video and audio producer, at heart I'm still a software developer: -I'll re-use 100 libraries to avoid writing 10 lines of code - standing on the shoulders of giants is the only way I know how I get around. +I'll reuse 100 libraries to avoid writing 10 lines of code - standing on the shoulders of giants is the only way I know how I get around. But I've looked for a way to mark my videos and stories as being made by humans, not AI, and I couldn't find one that worked in exactly the way I want. diff --git a/scripts/backup-40-compiler-driven-development.md b/scripts/backup-40-compiler-driven-development.md index d8c9f8f..255b1a9 100644 --- a/scripts/backup-40-compiler-driven-development.md +++ b/scripts/backup-40-compiler-driven-development.md @@ -239,7 +239,7 @@ async fn create_user(Json(payload): Json) notes: The second is more interesting, a post handler creating a user from a validated payload of json, and returning the new user as json. -BOTH input and ouput of this handler are documented and their enforced by the type signature. +BOTH input and output of this handler are documented and their enforced by the type signature. OK, let's break this, what status codes have we got? @@ -251,7 +251,7 @@ notes: Looks like there's an opening for a new status code. -Now this is interesting. Instead of giving us some options of what valid codes are available, which it would if we'd mispelled one +Now this is interesting. Instead of giving us some options of what valid codes are available, which it would if we'd misspelled one --- @@ -371,7 +371,7 @@ Refactor. "Writing a compiler that would accept all of the valid programs is not possible, thus we're left with the next best thing: a compiler that will reject all invalid programs at a cost of being overly strict." - [x] who said this? -Rust forces you to fix all your future bugs before you deploy. This causes the steeper learning curve, but given that all future bugs are crammed into the first compile, it's a suprisingly flat curve! +Rust forces you to fix all your future bugs before you deploy. This causes the steeper learning curve, but given that all future bugs are crammed into the first compile, it's a surprisingly flat curve! --- @@ -380,7 +380,7 @@ Rust forces you to fix all your future bugs before you deploy. This causes the s notes: As you know, languages are read far more often than they are written. But there's another part to the story here. -Your programs, if you're lucky and doing your job right, will be used by orders of magnatude more people than those who read the code. +Your programs, if you're lucky and doing your job right, will be used by orders of magnitude more people than those who read the code. So it follows that some small sacrifice of readability is valid, if it benefits you. --- @@ -491,7 +491,7 @@ fn correct_transitions() { bedroom_light.turn_on().turn_off().turn_on(); } -// Primary stuct +// Primary struct struct Light { state: State, } @@ -514,14 +514,14 @@ impl ResponseState for Off{} ```rust[] -// Methods availabe only in the Start state +// Methods available only in the Start state impl Light { fn turn_on(self) -> Light { Light { state: On } } } -// Methods availabe only in the Headers state +// Methods available only in the Headers state impl Light { fn turn_off(&self) -> Light { Light { state: Off } @@ -534,7 +534,7 @@ impl Light { //impl Light { // fn flip(self) -> Light { -// Methods availabe in any state +// Methods available in any state impl Light { fn transition() -> Light {