Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Examples from tutorial and other documentations of Rust.

License

NotificationsYou must be signed in to change notification settings

eliovir/rust-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Rust-examples is a repository togather example codes from tutorial and other documentations ofRust into files, ready to compile.

Examples are tested with version 1.64.0 and 1.68.0-nightly.

Files

  • Homepage
    • what_it_looks_like.rs,what_it_looks_like2.rs,what_it_looks_like3.rs
  • Old Tutorial, deprecated in favor of theBook
    • 2.1 Compiling your first program:tutorial-02_1-hello.rs
    • 3 Syntax basics:tutorial-03-syntax_basics.rs
    • 4.2 Pattern matching:tutorial-04_2-pattern-matching.rs
    • 4.3 Loops (for,while,loop):tutorial-04_3-loops.rs
    • 5.1 Structs:tutorial-05_1-structs.rs
    • 5.2 Enums:tutorial-05_2-enum.rs
    • 5.3 Tuples:tutorial-05_3-tuples.rs
    • 15 Closures:tutorial-15-closure.rs
    • 16 Methods, withconstructor:tutorial-16-methods.rs
    • 17 Generics:tutorial-17-generics.rs
  • Old Rust Threads and Communication Guide, moved into theRust Programming Language book
    • 2.1 Communication:tutorial-tasks-02_1-communication.rs
    • 2.3 Sharing immutable data without copy: Arc:tutorial-tasks-02_3-arc.rs
  • Book
    • 5.6 Concurrency, threads:book-5-6-threads.rs
  • Doc unit testing, moved into theRust Programming Language book.
    • Unit testing in Rust:unittests.rs
  • Old Rust Cheatsheet
    • Use Struct to express phantom types:phantom_type.rs
  • API
  • Some new files:
    • Makefile to compile, run tests and run benchmarks
    • .travis.yml to add the repository toTravis CI andRust CI
    • A library and its unit tests and benchmarks for 2 Fibonacci functions (a reccursive and a non reccursive):fibonacci.rs
    • A struct to manage dates:date.rs
    • Different syntaxes to find the maximum value in a vector:find_max.rs
    • A struct to manage INI files:inifile.rs
    • A script to print TBX entries from CSV terminology:datumbazo2tbx.rs
    • Design pattern Decorator:design_pattern-decorator.rs anddesign_pattern-decorator2.rs
    • Design pattern Strategy:design_pattern-strategy.rs
    • Design pattern Observer:design_pattern-observer.rs
    • Design pattern Command:design_pattern-command.rs
    • Design pattern State:design_pattern-state.rs
    • Design pattern Template method:design_pattern-templatemethod.rs
    • Design pattern Chain of Command:design_pattern-chain_of_command.rs
    • Design pattern Visitor:design_pattern-visitor.rs
    • Finite state machine:finite-state-machine.rs

Compile and running it

You will need the version 1.64.0 of the rust compiler.If you encounter problems, make sure you have the right version before creating an issue.

The simplest way to buildrust-examples is to do a clone and usemake to compile:

git clone https://github.com/eliovir/rust-examplescd rust-examplesmake

To run tests and benchmarks (benchmarks need Nightly):

make testsmake bench

To get help on commands:

make help

Contributing

  1. Fork it (git clone https://github.com/eliovir/rust-examples)
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Make your changes, and add tests for them
  4. Test your changes (make test)
  5. Commit your changes (git commit -am 'Add some feature')
  6. Push to the branch (git push origin my-new-feature)
  7. Create new Pull Request

Links

other projects have similar goals: providing Rust code snippets:

License

Rust is primarily distributed under the terms of both the MIT licenseand the Apache License (Version 2.0), with portions covered by variousBSD-like licenses.

These codes are distributed under the MIT license.

See LICENSE for details.

About

Examples from tutorial and other documentations of Rust.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp