Skip to content

Instantly share code, notes, and snippets.

@bartolsthoorn
Created August 23, 2014 16:47
Show Gist options
  • Save bartolsthoorn/843b75f257c396733c97 to your computer and use it in GitHub Desktop.
Save bartolsthoorn/843b75f257c396733c97 to your computer and use it in GitHub Desktop.
`simhash::hash` requires a `&str`
extern crate simhash;
use std::sync::Future;
/// DOM Tree
pub struct Tree {
html: String,
pub hash: Future<u64>
}
impl Tree {
pub fn new(html: String) -> Tree {
Tree {
html: html,
hash: Future::spawn(proc() { simhash::hash(html.as_slice()) })
}
}
}
@bartolsthoorn
Copy link
Author

html.rs:13:13: 13:17 note: html moved here because it has type collections::string::String, which is non-copyable (perhaps you meant to use clone()?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment