This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using Autofac; | |
| namespace DemoApp | |
| { | |
| // This interface helps decouple the concept of | |
| // "writing output" from the Console class. We | |
| // don't really "care" how the Write operation | |
| // happens, just that we can write. | |
| public interface IOutput |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #![feature(existential_type)] | |
| type Result<T> = std::result::Result<T, failure::Error>; | |
| trait MyTrait { | |
| fn greet(&self) -> String; | |
| } | |
| struct MyType {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # ~/.bashrc: executed by bash(1) for non-login shells. | |
| # see /usr/share/doc/bash/examples/startup-files (in the package bash-doc) | |
| # for examples | |
| # If not running interactively, don't do anything | |
| case $- in | |
| *i*) ;; | |
| *) return;; | |
| esac |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #![forbid(overflowing_literals,)] | |
| #![deny(unsafe_code)] // Do not remove! Change to `allow` to explicitly opt-in to using `unsafe` (facilitates auditing) | |
| // vvv Safety-critical application lints (pedantic: use for safety-critical applications only) vvv | |
| #![deny(clippy::cast_possible_truncation, clippy::cast_possible_wrap, clippy::cast_precision_loss, | |
| clippy::cast_sign_loss, clippy::float_cmp_const, clippy::indexing_slicing, clippy::integer_arithmetic, | |
| clippy::maybe_infinite_iter, clippy::option_unwrap_used, clippy::result_unwrap_used,)] | |
| // ^^^ End of safety-critical lint section ^^^ | |
| #![warn(clippy::clone_on_ref_ptr, clippy::decimal_literal_representation, clippy::default_trait_access, | |
| clippy::doc_markdown, clippy::else_if_without_else, clippy::empty_enum, clippy::enum_glob_use, | |
| clippy::expl_impl_clone_on_copy, clippy::fallible_impl_from, clippy::filter_map, clippy::if_not_else, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| enum State { | |
| On, | |
| Off, | |
| } | |
| trait Foo { | |
| const STATE: State; | |
| } | |
| struct A; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //does not work as intended :( | |
| #[inline] | |
| pub(super) fn validate_frame(roll: u8) -> Result<u8> { | |
| let mut frame_validator = || -> Error { | |
| for frame in Game::FIRST_FRAME..=Game::LAST_FRAME { | |
| let first_roll = roll; | |
| yield Ok(first_roll); | |
| // this frame has a second roll if it's the last frame OR if first roll was not a strike |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| brad@SocratesV:~/Development/rust/rust$ rg 1.26.0 | |
| src/bootstrap/channel.rs | |
| 27:pub const CFG_RELEASE_NUM: &str = "1.26.0"; | |
| src/libstd/lib.rs | |
| 437:#[stable(feature = "i128", since = "1.26.0")] | |
| 467:#[stable(feature = "i128", since = "1.26.0")] | |
| src/libstd/path.rs | |
| 909:#[stable(feature = "fused", since = "1.26.0")] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fn main() { | |
| let opt = Opt::from_args(); | |
| if let Err(err) = run(&opt) { | |
| eprintln!("error: {}", err); | |
| std::process::exit(1); | |
| } | |
| } | |
| // -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::fmt; | |
| #[derive(Debug, Clone, Copy)] | |
| pub enum CardinalPoint { | |
| North = 0x2191, // ↑ | |
| NorthEast = 0x2197, // ↗ | |
| East = 0x2192, // → | |
| SouthEast = 0x2198, // ↘ | |
| South = 0x2193, // ↓ | |
| SouthWest = 0x2199, // ↙ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| use std::fmt; | |
| #[derive(Debug, Clone, Copy)] | |
| pub enum CardinalPoint { | |
| North = 0x2191, // ↑ | |
| NorthEast = 0x2197, // ↗ | |
| East = 0x2192, // → | |
| SouthEast = 0x2198, // ↘ | |
| South = 0x2193, // ↓ | |
| SouthWest = 0x2199, // ↙ |