Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Rust cheat sheet #2

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
all:
cd gnucobol-cheat-sheet; $(MAKE) all
cd cobol-cheat-sheet; $(MAKE) all
cd rust-cheat-sheet; $(MAKE) all

clean:
cd gnucobol-cheat-sheet; $(MAKE) clean
cd cobol-cheat-sheet; $(MAKE) clean
cd rust-cheat-sheet; $(MAKE) clean
3 changes: 3 additions & 0 deletions rust-cheat-sheet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*.log
*.aux
*.out
13 changes: 13 additions & 0 deletions rust-cheat-sheet/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

FILE=rust-cheat-sheet-v1

all: $(FILE).pdf

$(FILE).pdf: $(FILE).tex ../common/cheat-style.sty
pdflatex $(FILE).tex

view: $(FILE).pdf
evince $(FILE).pdf &

clean:
rm -f *.bbl *.aux *.dvi *.ps *.log *~ *.out
Binary file added rust-cheat-sheet/rust-cheat-sheet-v1.pdf
Binary file not shown.
92 changes: 92 additions & 0 deletions rust-cheat-sheet/rust-cheat-sheet-v1.tex
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
\documentclass[10pt,landscape]{article}

\usepackage{../common/cheat-style}
\usepackage{url}
\usepackage{hyperref}

\begin{document}

\setlength{\premulticols}{1pt}
\setlength{\postmulticols}{1pt}
\setlength{\multicolsep}{1pt}
\setlength{\columnsep}{2em}

\def\csRevision{1}
\def\csSubtitle{edition 2021}
\makeheader{The RUST Language}

\begin{multicols}{3}

\vbox{
\subsection{Useful Links}
Language: \url{https://www.rust-lang.org/} \\
Install: \url{https://rustup.rs}\\
Packages: \url{https://crates.io}\\
Package Docs: \url{https://docs.rs}\\
\subsection{Hello World}

File \verb+src/main.rs+:\\
\begin{verbatim}
pub fn main() -> Res<()> {
println!("Hello {} !", "World");
Ok( () )
}
\end{verbatim}

File \verb+Cargo.toml+:\\
\begin{verbatim}
[package]
edition = "2018"
name = "hello_world"
version = "1.0.0"
[[bin]] # only for an executable
name = "my-hello-world"
path = "src/main.rs"
[dependencies]
gitdep = { git = "https://...", tag = '1.10.11' }
failure = "0.1.7" # on crates.io
concur = { path = "../path-to-source" }
[patch.crates-io] # for modified dependencies
failure = { path = "../my-own-version" }
\end{verbatim}

\begin{tabular}{ll}
{\tt cargo build} & Build the project \\
{\tt cargo update} & Update {\tt Cargo.lock} file \\
\verb+cargo doc --open+ & Build documentation \\
\end{tabular}

\subsection{AAA}
}

\vbox{
\subsection{BBB}
}

\vbox{
\subsection{CCC}
}

\end{multicols}

\newpage

\makeheader{The RUST Language }

\begin{multicols}{3}

\vbox{
\subsection{AAA}
}

\vbox{
\subsection{AAA}
}

\vbox{
\subsection{AAA}
}

\end{multicols}

\end{document}