Skip to content

Commit

Permalink
Fix function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
alanhdu committed Oct 17, 2018
1 parent dc63fb0 commit 696c7d0
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 12 deletions.
3 changes: 1 addition & 2 deletions crates/ra_analysis/src/descriptors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,7 @@ impl Link {
root: ast::Root<'a>,
) -> ast::Module<'a> {
modules(root)
.filter(|(name, _)| name == &tree.link(self).name)
.next()
.find(|(name, _)| name == &tree.link(self).name)
.unwrap()
.1
}
Expand Down
2 changes: 1 addition & 1 deletion crates/ra_analysis/src/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ impl AnalysisImpl {

// If we have a method call eat the first param since it's just self.
if has_self {
commas = commas + 1;
commas += 1;
}

current_parameter = Some(commas);
Expand Down
2 changes: 1 addition & 1 deletion crates/ra_editor/src/typing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ pub fn join_lines(file: &File, range: TextRange) -> LocalEdit {
pub fn on_enter(file: &File, offset: TextUnit) -> Option<LocalEdit> {
let comment = find_leaf_at_offset(file.syntax(), offset)
.left_biased()
.and_then(|it| ast::Comment::cast(it))?;
.and_then(ast::Comment::cast)?;

if let ast::CommentFlavor::Multiline = comment.flavor() {
return None;
Expand Down
2 changes: 1 addition & 1 deletion crates/ra_lsp_server/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ fn main() -> Result<()> {
.directory("log")
.start()?;
info!("lifecycle: server started");
match ::std::panic::catch_unwind(|| main_inner()) {
match ::std::panic::catch_unwind(main_inner) {
Ok(res) => {
info!("lifecycle: terminating process with {:?}", res);
res
Expand Down
4 changes: 2 additions & 2 deletions crates/ra_lsp_server/src/main_loop/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ pub fn handle_runnables(
.filter_map(|ws| {
let tgt = ws.target_by_root(path)?;
Some((
tgt.package(ws).name(ws).clone(),
tgt.name(ws).clone(),
tgt.package(ws).name(ws),
tgt.name(ws),
tgt.kind(ws),
))
})
Expand Down
1 change: 0 additions & 1 deletion crates/ra_lsp_server/src/project_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ pub fn workspace_loader() -> (Worker<PathBuf, Result<CargoWorkspace>>, ThreadWat
1,
|input_receiver, output_sender| {
input_receiver
.into_iter()
.map(|path| CargoWorkspace::from_cargo_metadata(path.as_path()))
.for_each(|it| output_sender.send(it))
},
Expand Down
1 change: 0 additions & 1 deletion crates/ra_lsp_server/src/vfs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pub fn roots_loader() -> (Worker<PathBuf, (PathBuf, Vec<FileEvent>)>, ThreadWatc
128,
|input_receiver, output_sender| {
input_receiver
.into_iter()
.map(|path| {
debug!("loading {} ...", path.as_path().display());
let events = load_root(path.as_path());
Expand Down
2 changes: 1 addition & 1 deletion crates/ra_syntax/src/lexer/ptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl<'s> Ptr<'s> {
/// For example, 0 will return the current token, 1 will return the next, etc.
pub fn nth(&self, n: u32) -> Option<char> {
let mut chars = self.chars().peekable();
chars.by_ref().skip(n as usize).next()
chars.by_ref().nth(n as usize)
}

/// Checks whether the current character is `c`.
Expand Down
2 changes: 1 addition & 1 deletion crates/ra_syntax/src/reparsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ fn find_reparsable_node(
}

fn is_balanced(tokens: &[Token]) -> bool {
if tokens.len() == 0
if tokens.is_empty()
|| tokens.first().unwrap().kind != L_CURLY
|| tokens.last().unwrap().kind != R_CURLY
{
Expand Down
2 changes: 1 addition & 1 deletion crates/ra_syntax/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use std::fmt::Write;

/// Parse a file and create a string representation of the resulting parse tree.
pub fn dump_tree(syntax: SyntaxNodeRef) -> String {
let mut errors: Vec<_> = syntax.root_data().iter().cloned().collect();
let mut errors: Vec<_> = syntax.root_data().to_vec();
errors.sort_by_key(|e| e.offset);
let mut err_pos = 0;
let mut level = 0;
Expand Down

0 comments on commit 696c7d0

Please sign in to comment.