Speed Up Your Python with Rust by Maxwell Flitton
Author:Maxwell Flitton [Maxwell Flitton]
Language: eng
Format: epub, pdf
Publisher: Packt Publishing
Published: 2022-01-20T16:00:00+00:00
We can also see that we must import the function, as it is super to the module. Inside this module, we can run standard tests that check to see whether the integers we pass in calculate the Fibonacci number we expect with the following code: #[test]
fn test_one() {
assert_eq!(fibonacci_number(1), 1);
}
#[test]
fn test_two() {
assert_eq!(fibonacci_number(2), 1);
}
#[test]
fn test_three() {
assert_eq!(fibonacci_number(3), 2);
}
#[test]
fn test_twenty() {
assert_eq!(fibonacci_number(20), 6765);
}
Here, we can see that we have decorated our test functions with the #[test] macro. If they do not produce the results that we expect, then assert_eq! and the test will fail. We also must note that our function will panic if we pass in zero or a negative value.
Download
Speed Up Your Python with Rust by Maxwell Flitton.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Exploring Deepfakes by Bryan Lyon and Matt Tora(5657)
Robo-Advisor with Python by Aki Ranin(5581)
Offensive Shellcode from Scratch by Rishalin Pillay(4999)
Ego Is the Enemy by Ryan Holiday(4422)
Management Strategies for the Cloud Revolution: How Cloud Computing Is Transforming Business and Why You Can't Afford to Be Left Behind by Charles Babcock(4278)
Learning C# by Developing Games with Unity 2021 by Harrison Ferrone(3119)
Python for ArcGIS Pro by Silas Toms Bill Parker(3092)
Speed Up Your Python with Rust by Maxwell Flitton(3055)
OPNsense Beginner to Professional by Julio Cesar Bueno de Camargo(3031)
Extreme DAX by Michiel Rozema & Henk Vlootman(3006)
Liar's Poker by Michael Lewis(2989)
Agile Security Operations by Hinne Hettema(2985)
Linux Command Line and Shell Scripting Techniques by Vedran Dakic and Jasmin Redzepagic(2970)
Essential Cryptography for JavaScript Developers by Alessandro Segala(2946)
Microsoft 365 and SharePoint Online Cookbook by Gaurav Mahajan Sudeep Ghatak Nate Chamberlain Scott Brewster(2939)
Elevating React Web Development with Gatsby by Samuel Larsen-Disney(2897)
Cryptography Algorithms by Massimo Bertaccini(2835)
AI-Powered Commerce by Andy Pandharikar & Frederik Bussler(2828)
Incident Response Techniques for Ransomware Attacks by Oleg Skulkin(2811)