@@ -25,7 +25,7 @@ use log::*;
25
25
use std:: path:: { Path , PathBuf } ;
26
26
27
27
/// Cleanup documentation code blocks. The `docs` are expected to have
28
- /// the preceeding `///` or `//!` prefixes already trimmed away. Rust code
28
+ /// the preceding `///` or `//!` prefixes already trimmed away. Rust code
29
29
/// blocks will ignore lines beginning with `#`. Code block annotations
30
30
/// that are common to Rust will be converted to `rust` allow for markdown
31
31
/// syntax coloring.
@@ -241,7 +241,7 @@ fn extract_and_process_docs(vfs: &Vfs, file: &Path, row_start: Row<ZeroIndexed>)
241
241
. and_then ( empty_to_none)
242
242
}
243
243
244
- /// Extracts a function, method, struct, enum, or trait decleration
244
+ /// Extracts a function, method, struct, enum, or trait declaration
245
245
/// from source.
246
246
pub fn extract_decl (
247
247
vfs : & Vfs ,
@@ -863,7 +863,7 @@ fn format_method(rustfmt: Rustfmt, fmt_config: &FmtConfig, the_type: String) ->
863
863
result. trim ( ) . into ( )
864
864
}
865
865
866
- /// Builds a hover tooltip composed of the function signature or type decleration , doc URL
866
+ /// Builds a hover tooltip composed of the function signature or type declaration , doc URL
867
867
/// (if available in the save-analysis), source extracted documentation, and code context
868
868
/// for local variables.
869
869
pub fn tooltip (
@@ -1118,9 +1118,9 @@ pub mod test {
1118
1118
/// Clears and returns the recorded output lines
1119
1119
pub fn reset ( & self ) -> Vec < String > {
1120
1120
let mut lines = self . lines . lock ( ) . unwrap ( ) ;
1121
- let mut swaped = Vec :: new ( ) ;
1122
- :: std:: mem:: swap ( & mut * lines, & mut swaped ) ;
1123
- swaped
1121
+ let mut swapped = Vec :: new ( ) ;
1122
+ :: std:: mem:: swap ( & mut * lines, & mut swapped ) ;
1123
+ swapped
1124
1124
}
1125
1125
}
1126
1126
@@ -1277,7 +1277,7 @@ pub mod test {
1277
1277
}
1278
1278
1279
1279
/// Strips indentation from string literals by examining
1280
- /// the indent of the first non-empty line. Preceeding
1280
+ /// the indent of the first non-empty line. Preceding
1281
1281
/// and trailing whitespace is also removed.
1282
1282
fn noindent ( text : & str ) -> String {
1283
1283
let indent = text
@@ -1636,56 +1636,56 @@ pub mod test {
1636
1636
let expected = "pub fn foo() -> Foo<u32>" ;
1637
1637
let row_start = Row :: new_zero_indexed ( 10 ) ;
1638
1638
let actual = extract_decl ( & vfs, file, row_start)
1639
- . expect ( "fuction decleration " )
1639
+ . expect ( "function declaration " )
1640
1640
. join ( "\n " ) ;
1641
1641
assert_eq ! ( expected, actual) ;
1642
1642
1643
1643
let expected = "pub struct Foo<T>" ;
1644
1644
let row_start = Row :: new_zero_indexed ( 15 ) ;
1645
1645
let actual = extract_decl ( & vfs, file, row_start)
1646
- . expect ( "struct decleration " )
1646
+ . expect ( "struct declaration " )
1647
1647
. join ( "\n " ) ;
1648
1648
assert_eq ! ( expected, actual) ;
1649
1649
1650
1650
let expected = "pub enum Bar" ;
1651
1651
let row_start = Row :: new_zero_indexed ( 20 ) ;
1652
1652
let actual = extract_decl ( & vfs, file, row_start)
1653
- . expect ( "enum decleration " )
1653
+ . expect ( "enum declaration " )
1654
1654
. join ( "\n " ) ;
1655
1655
assert_eq ! ( expected, actual) ;
1656
1656
1657
1657
let expected = "pub struct NewType(pub u32, f32)" ;
1658
1658
let row_start = Row :: new_zero_indexed ( 25 ) ;
1659
1659
let actual = extract_decl ( & vfs, file, row_start)
1660
- . expect ( "tuple decleration " )
1660
+ . expect ( "tuple declaration " )
1661
1661
. join ( "\n " ) ;
1662
1662
assert_eq ! ( expected, actual) ;
1663
1663
1664
1664
let expected = "pub fn new() -> NewType" ;
1665
1665
let row_start = Row :: new_zero_indexed ( 28 ) ;
1666
1666
let actual = extract_decl ( & vfs, file, row_start)
1667
- . expect ( "struct function decleration " )
1667
+ . expect ( "struct function declaration " )
1668
1668
. join ( "\n " ) ;
1669
1669
assert_eq ! ( expected, actual) ;
1670
1670
1671
1671
let expected = "pub fn bar<T: Copy + Add>(&self, the_really_long_name_string: String, the_really_long_name_foo: Foo<T>) -> Vec<(String, Foo<T>)>" ;
1672
1672
let row_start = Row :: new_zero_indexed ( 32 ) ;
1673
1673
let actual = extract_decl ( & vfs, file, row_start)
1674
- . expect ( "long struct method decleration with generics" )
1674
+ . expect ( "long struct method declaration with generics" )
1675
1675
. join ( "\n " ) ;
1676
1676
assert_eq ! ( expected, actual) ;
1677
1677
1678
1678
let expected = "pub trait Baz<T> where T: Copy" ;
1679
1679
let row_start = Row :: new_zero_indexed ( 37 ) ;
1680
1680
let actual = extract_decl ( & vfs, file, row_start)
1681
- . expect ( "enum decleration " )
1681
+ . expect ( "enum declaration " )
1682
1682
. join ( "\n " ) ;
1683
1683
assert_eq ! ( expected, actual) ;
1684
1684
1685
1685
let expected = "fn make_copy(&self) -> Self" ;
1686
1686
let row_start = Row :: new_zero_indexed ( 38 ) ;
1687
1687
let actual = extract_decl ( & vfs, file, row_start)
1688
- . expect ( "trait method decleration " )
1688
+ . expect ( "trait method declaration " )
1689
1689
. join ( "\n " ) ;
1690
1690
assert_eq ! ( expected, actual) ;
1691
1691
@@ -1705,7 +1705,7 @@ pub mod test {
1705
1705
) ;
1706
1706
let row_start = Row :: new_zero_indexed ( 47 ) ;
1707
1707
let actual = extract_decl ( & vfs, file, row_start)
1708
- . expect ( "trait decleration multiline" )
1708
+ . expect ( "trait declaration multiline" )
1709
1709
. join ( "\n " ) ;
1710
1710
assert_eq ! ( expected, actual) ;
1711
1711
@@ -1719,7 +1719,7 @@ pub mod test {
1719
1719
) ;
1720
1720
let row_start = Row :: new_zero_indexed ( 53 ) ;
1721
1721
let actual = extract_decl ( & vfs, file, row_start)
1722
- . expect ( "function decleration multiline" )
1722
+ . expect ( "function declaration multiline" )
1723
1723
. join ( "\n " ) ;
1724
1724
assert_eq ! ( expected, actual) ;
1725
1725
}
0 commit comments