Skip to content

Instantly share code, notes, and snippets.

View vadixidav's full-sized avatar
🦀
Rust ❤️

Geordon Worley vadixidav

🦀
Rust ❤️
View GitHub Profile
/// A lexicon contains all the definitions known in a given context.
#[derive(Clone, Debug, Default)]
struct Lexicon<'a> {
scopes: Vec<&'a Scope>,
}
impl<'a> Lexicon<'a> {
/// Erases the lifetime of the Scope reference internally since
/// it will be forgotten when this is dropped.
fn with<'b>(&'b mut self, scope: &Scope) -> ScopedLex<'b, 'a> {
#[inline]
fn write_u64<T: ByteOrder>(&mut self, n: u64) -> Result<()> {
let mut buf = [0; 8];
T::write_u64(&mut buf, n);
self.write_all(&buf)
}
[package]
name = "cbindgen_test"
version = "0.2.0"
authors = ["Geordon Worley <vadixidav@gmail.com>"]
[lib]
crate-type = ["staticlib"]
[profile]
panic = "abort"
$ cargo run --release --example langtons_ant
Compiling gridsim-ui v0.1.2 (file:///C:/Users/vadix/code/gridsim-ui)
error: expected `{`, found `}`
--> examples\langtons_ant.rs:33:5
|
33 | }
| ^
error: aborting due to previous error
error[E0499]: cannot borrow `*self` as mutable more than once at a time
--> src\grid.rs:199:9
|
198 | self.step();
| ---- first mutable borrow occurs here
199 | self.update();
| ^^^^ second mutable borrow occurs here
200 | }
| - first borrow ends here
error[E0119]: conflicting implementations of trait `neighborhood::GetNeighbors<'_, usize, neumann::Neighbors<&_>>` for type `SquareGrid<_>`:
--> src\neumann.rs:195:1
|
177 | / impl<'a, C, S> GetNeighbors<'a, usize, Neighbors<&'a C>> for SquareGrid<S>
178 | | where
179 | | S: Sim<Cell = C>,
180 | | {
... |
192 | | }
193 | | }
fn fold_op<F: Fn(f64, f64)>(input: &[u8], init: f64, f: F) -> IResult<&[u8], f64> {
fold_many0!(ws!(alt!(apply!(list) | apply!(f64::from_str))), init, f)
}
named!(list<f64>, delimited!(tag!("("), ws!(alt!(
proceed!(tag!("+"), apply!(fop, 0.0, |acc, item| acc + item))
)), tag!(")")));
error: unexpected end of macro invocation
```rust
fn fold_op<F: Fn(f64, f64)>(input: &[u8], init: f64, f: F) -> IResult<&[u8], f64> {
    fold_many0!(ws!(alt!(apply!(list) | apply!(f64::from_str))), init, f)
}
named!(list<f64>, delimited!(tag!("("), ws!(alt!(
    proceed!(tag!("+"), apply!(fop, 0.0, |acc, item| acc + item))
)), tag!(")")));
```
fn fold_op<F: Fn(f64, f64)>(input: &[u8], init: f64, f: F) -> IResult<&[u8], f64> {
fold_many0!(ws!(alt!(apply!(list) | apply!(f64::from_str))), init, f)
}
named!(list<f64>, delimited!(tag!("("), ws!(alt!(
proceed!(tag!("+"), apply!(fop, 0.0, |acc, item| acc + item))
)), tag!(")")));
worleyg@GZB3WD2 MINGW64 ~/project/httpgit/build (conan)
$ ls
CMakeCache.txt CMakeFiles/ conanbuildinfo.cmake conaninfo.txt
r
worleyg@GZB3WD2 MINGW64 ~/project/httpgit/build (conan)
$ rm -rf *
worleyg@GZB3WD2 MINGW64 ~/project/httpgit/build (conan)
$ conan install ..
WARN: Conflict in OpenSSL/1.0.2h@lasote/stable