Skip to content

Instantly share code, notes, and snippets.

View mitsuhiko's full-sized avatar
🖥️
What's happening

Armin Ronacher mitsuhiko

🖥️
What's happening
View GitHub Profile
$ pip install libsourcemap
Collecting libsourcemap
Downloading libsourcemap-0.6.0-py2.py3-none-macosx_10_9_intel.whl (492kB)
100% |████████████████████████████████| 501kB 1.6MB/s
Collecting cffi>=1.6.0 (from libsourcemap)
Downloading cffi-1.10.0-cp27-cp27m-macosx_10_6_intel.whl (226kB)
100% |████████████████████████████████| 235kB 3.7MB/s
Collecting pycparser (from cffi>=1.6.0->libsourcemap)
Installing collected packages: pycparser, cffi, libsourcemap
Successfully installed cffi-1.10.0 libsourcemap-0.6.0 pycparser-2.17
error: `rv` does not live long enough
--> src/read.rs:143:43
|
143 | extract_variants(&mut rv, file);
| ^^ does not live long enough
...
194 | }
| - borrowed value only lives until here
|
note: borrowed value must be valid for the lifetime 'a as defined on the body at 137:62...
--> src/read.rs:155:51
|
155 | if let &OFile::MachFile { ref header, ref commands, .. } = file {
| ^^^^^^^^^^^^
|
note: first, the lifetime cannot outlive the lifetime 'a as defined on the body at 154:75...
--> src/read.rs:154:76
|
154 | fn extract_variants<'a>(rv: &'a mut Vec<Variant>, file: &'a OFile) {
| ^
pub fn get_variants(&self) -> Result<Vec<Variant>> {
let mut rv = vec![];
match self.ofile {
OFile::FatFile { ref files, .. } => {
for &(_, ref file) in files {
extract_variants(&mut rv, file);
}
}
OFile::MachFile { .. } => {
pub fn copy_with_progress<R: ?Sized, W: ?Sized>(progress: &ProgressBar,
reader: &mut R, writer: &mut W)
-> io::Result<u64>
where R: Read, W: Write
{
let mut buf = [0; 16384];
let mut written = 0;
loop {
let len = match reader.read(&mut buf) {
Ok(0) => return Ok(written),
[(1, 1123),
(2, 266),
(3, 153),
(4, 77),
(5, 62),
(6, 49),
(7, 29),
(8, 15),
(9, 20),
(10, 15),
  • Feature Name: public_private_dependencies
  • Start Date: 2017-04-03
  • RFC PR: (leave this empty)
  • Rust Issue: (leave this empty)

Summary

Introduce a public/private distinction to crate dependencies.

osascript <<EOF
tell application "iTerm2"
activate
write text "echo left"
tell current session of current window to set newSplit to split vertically with same profile
tell newSplit
select
write text "echo top"
end tell
tell current session of current window to set newSplit to split horizontally with same profile
fn get_nsmap_mut(&mut self) -> &mut NamespaceMap {
if self.nsmap.is_none() {
self.nsmap = Some(Rc::new(NamespaceMap::new()));
}
{
let nsmap_copy = {
let nsmap = self.nsmap.as_mut().unwrap();
if Rc::strong_count(nsmap) == 1 {
return Rc::get_mut(nsmap).unwrap()
error[E0308]: mismatched types
--> src/lib.rs:564:32
|
564 | self.attributes.remove(&name.as_qname())
| ^^^^^^^^^^^^^^^^ lifetime mismatch
|
= note: expected type `&QName<'static>`
found type `&QName<'a>`
note: the lifetime 'a as defined on the body at 563:84...
--> src/lib.rs:563:85