librustdoc: De-@mut librustdoc
This commit is contained in:
@@ -88,7 +88,7 @@ pub fn run_core (libs: HashSet<Path>, cfgs: ~[~str], path: &Path) -> (clean::Cra
|
|||||||
let ctxt = @ctxt;
|
let ctxt = @ctxt;
|
||||||
local_data::set(super::ctxtkey, ctxt);
|
local_data::set(super::ctxtkey, ctxt);
|
||||||
|
|
||||||
let v = @mut RustdocVisitor::new();
|
let mut v = RustdocVisitor::new();
|
||||||
v.visit(&ctxt.crate);
|
v.visit(&ctxt.crate);
|
||||||
|
|
||||||
(v.clean(), analysis)
|
(v.clean(), analysis)
|
||||||
|
|||||||
@@ -267,11 +267,11 @@ fn rust_input(cratefile: &str, matches: &getopts::Matches) -> Output {
|
|||||||
/// This input format purely deserializes the json output file. No passes are
|
/// This input format purely deserializes the json output file. No passes are
|
||||||
/// run over the deserialized output.
|
/// run over the deserialized output.
|
||||||
fn json_input(input: &str) -> Result<Output, ~str> {
|
fn json_input(input: &str) -> Result<Output, ~str> {
|
||||||
let input = match File::open(&Path::new(input)) {
|
let mut input = match File::open(&Path::new(input)) {
|
||||||
Some(f) => f,
|
Some(f) => f,
|
||||||
None => return Err(format!("couldn't open {} for reading", input)),
|
None => return Err(format!("couldn't open {} for reading", input)),
|
||||||
};
|
};
|
||||||
match json::from_reader(@mut input as @mut io::Reader) {
|
match json::from_reader(&mut input) {
|
||||||
Err(s) => Err(s.to_str()),
|
Err(s) => Err(s.to_str()),
|
||||||
Ok(json::Object(obj)) => {
|
Ok(json::Object(obj)) => {
|
||||||
let mut obj = obj;
|
let mut obj = obj;
|
||||||
@@ -332,6 +332,6 @@ fn json_output(crate: clean::Crate, res: ~[plugins::PluginJson], dst: Path) {
|
|||||||
json.insert(~"crate", crate_json);
|
json.insert(~"crate", crate_json);
|
||||||
json.insert(~"plugins", json::Object(plugins_json));
|
json.insert(~"plugins", json::Object(plugins_json));
|
||||||
|
|
||||||
let file = @mut File::create(&dst).unwrap();
|
let mut file = File::create(&dst).unwrap();
|
||||||
json::Object(json).to_writer(file as @mut io::Writer);
|
json::Object(json).to_writer(&mut file);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ pub fn run(input: &str, matches: &getopts::Matches) -> int {
|
|||||||
};
|
};
|
||||||
local_data::set(super::ctxtkey, ctx);
|
local_data::set(super::ctxtkey, ctx);
|
||||||
|
|
||||||
let v = @mut RustdocVisitor::new();
|
let mut v = RustdocVisitor::new();
|
||||||
v.visit(&ctx.crate);
|
v.visit(&ctx.crate);
|
||||||
let crate = v.clean();
|
let crate = v.clean();
|
||||||
let (crate, _) = passes::unindent_comments(crate);
|
let (crate, _) = passes::unindent_comments(crate);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ impl RustdocVisitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl RustdocVisitor {
|
impl RustdocVisitor {
|
||||||
pub fn visit(@mut self, crate: &ast::Crate) {
|
pub fn visit(&mut self, crate: &ast::Crate) {
|
||||||
self.attrs = crate.attrs.clone();
|
self.attrs = crate.attrs.clone();
|
||||||
fn visit_struct_def(item: &ast::item, sd: @ast::struct_def, generics:
|
fn visit_struct_def(item: &ast::item, sd: @ast::struct_def, generics:
|
||||||
&ast::Generics) -> Struct {
|
&ast::Generics) -> Struct {
|
||||||
|
|||||||
Reference in New Issue
Block a user