Skip to content

Commit 2837af7

Browse files
committed
fix(rust): cleanup/format imports
1 parent 47d1c6e commit 2837af7

File tree

5 files changed

+45
-43
lines changed

5 files changed

+45
-43
lines changed

asm-lsp/config_builder.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,11 @@ use std::{env::current_dir, path::PathBuf};
44

55
use anyhow::{anyhow, Result};
66
use clap::{arg, Args};
7+
use dialoguer::{theme::ColorfulTheme, Confirm, FuzzySelect, Input};
78
use dirs::config_dir;
89

910
use crate::types::{Arch, Assembler, Config, ConfigOptions, ProjectConfig, RootConfig};
1011

11-
use dialoguer::{theme::ColorfulTheme, Confirm, FuzzySelect, Input};
12-
1312
const ARCH_LIST: [Arch; 10] = [
1413
Arch::X86,
1514
Arch::X86_64,

asm-lsp/lsp.rs

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
use crate::{ustr, CompletionItems, DocumentStore, Hoverable, ServerStore};
2-
use std::borrow::ToOwned;
3-
use std::cmp::Ordering;
4-
use std::collections::{HashMap, HashSet};
5-
use std::convert::TryFrom;
6-
use std::fmt::Write as _;
7-
use std::fs::{create_dir_all, File};
8-
use std::io::BufRead;
9-
use std::path::{Path, PathBuf};
10-
use std::process::Command;
11-
use std::str::FromStr;
12-
use std::string::ToString;
13-
use std::sync::LazyLock;
1+
use std::{
2+
borrow::ToOwned,
3+
cmp::Ordering,
4+
collections::{HashMap, HashSet},
5+
convert::TryFrom as _,
6+
fmt::Write as _,
7+
fs::{create_dir_all, File},
8+
io::BufRead,
9+
path::{Path, PathBuf},
10+
process::Command,
11+
str::FromStr as _,
12+
string::ToString as _,
13+
sync::LazyLock,
14+
};
1415

1516
use anyhow::{anyhow, Result};
1617
use compile_commands::{CompilationDatabase, CompileArgs, CompileCommand, SourceFile};
@@ -32,10 +33,10 @@ use symbolic::common::{Language, Name, NameMangling};
3233
use symbolic_demangle::{Demangle, DemangleOptions};
3334
use tree_sitter::InputEdit;
3435

35-
use crate::types::Column;
3636
use crate::{
37-
Arch, ArchOrAssembler, Assembler, Completable, Config, ConfigOptions, Directive, Instruction,
38-
LspClient, NameToInstructionMap, RootConfig, TreeEntry,
37+
types::Column, ustr, Arch, ArchOrAssembler, Assembler, Completable, CompletionItems, Config,
38+
ConfigOptions, Directive, DocumentStore, Hoverable, Instruction, LspClient,
39+
NameToInstructionMap, RootConfig, ServerStore, TreeEntry,
3940
};
4041

4142
/// Prints information about the server

asm-lsp/parser.rs

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
1-
use crate::{ustr, AvrStatusRegister, AvrTiming};
2-
use std::collections::HashMap;
3-
use std::env::args;
4-
use std::fs;
5-
use std::io::Write;
6-
use std::iter::Peekable;
7-
use std::path::PathBuf;
8-
use std::str::{FromStr, Lines};
9-
10-
use crate::types::{
11-
Arch, Assembler, Directive, Instruction, InstructionForm, MMXMode, NameToDirectiveMap,
12-
NameToInstructionMap, NameToRegisterMap, Operand, OperandType, Register, RegisterBitInfo,
13-
RegisterType, RegisterWidth, XMMMode, Z80Timing, Z80TimingInfo, ISA,
1+
use std::{
2+
collections::HashMap,
3+
env::args,
4+
fs,
5+
io::Write as _,
6+
iter::Peekable,
7+
path::PathBuf,
8+
str::{FromStr, Lines},
149
};
15-
use crate::InstructionAlias;
1610

1711
use anyhow::{anyhow, Result};
1812
use htmlentity::entity::ICodedDataTrait;
@@ -26,6 +20,15 @@ use reqwest;
2620
use serde::Deserialize;
2721
use url_escape::encode_www_form_urlencoded;
2822

23+
use crate::{
24+
types::{
25+
Arch, Assembler, Directive, Instruction, InstructionForm, MMXMode, NameToDirectiveMap,
26+
NameToInstructionMap, NameToRegisterMap, Operand, OperandType, Register, RegisterBitInfo,
27+
RegisterType, RegisterWidth, XMMMode, Z80Timing, Z80TimingInfo, ISA,
28+
},
29+
ustr, AvrStatusRegister, AvrTiming, InstructionAlias,
30+
};
31+
2932
/// Parse all of the register information witin the documentation file
3033
///
3134
/// Current function assumes that the RST file is already read and that it's been given a reference

asm-lsp/test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#[cfg(test)]
22
mod tests {
3-
use core::panic;
43
use std::{collections::HashMap, path::PathBuf, str::FromStr};
54

65
use anyhow::Result;

asm_docs_parsing/src/main.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
use std::path::PathBuf;
22

3-
use ::asm_lsp::parser::{
4-
populate_6502_instructions, populate_arm_instructions, populate_ca65_directives,
5-
populate_gas_directives, populate_instructions, populate_masm_nasm_directives,
6-
populate_registers, populate_riscv_instructions, populate_riscv_registers,
7-
};
8-
use asm_lsp::{
9-
parser::{populate_avr_directives, populate_avr_instructions, populate_power_isa_instructions},
10-
Arch, Assembler, Directive, Instruction, Register,
11-
};
12-
133
use anyhow::{anyhow, Result};
144
use clap::{Parser, Subcommand};
155
use serde::{Deserialize, Serialize};
166

7+
use asm_lsp::{
8+
parser::{
9+
populate_6502_instructions, populate_arm_instructions, populate_avr_directives,
10+
populate_avr_instructions, populate_ca65_directives, populate_gas_directives,
11+
populate_instructions, populate_masm_nasm_directives, populate_power_isa_instructions,
12+
populate_registers, populate_riscv_instructions, populate_riscv_registers,
13+
},
14+
Arch, Assembler, Directive, Instruction, Register,
15+
};
16+
1717
#[derive(Debug, Clone, Copy, Serialize, Deserialize, clap::ValueEnum)]
1818
enum DocType {
1919
Instruction,

0 commit comments

Comments
 (0)