Use 2018-style absolute paths in examples
diff --git a/examples/heapsize/README.md b/examples/heapsize/README.md
index 1e36baf..a1f32d9 100644
--- a/examples/heapsize/README.md
+++ b/examples/heapsize/README.md
@@ -31,12 +31,12 @@
The trait impl generated by the custom derive here would look like:
```rust
-impl<'a, T: ?Sized + ::heapsize::HeapSize> ::heapsize::HeapSize for Demo<'a, T> {
+impl<'a, T: ?Sized + heapsize::HeapSize> heapsize::HeapSize for Demo<'a, T> {
fn heap_size_of_children(&self) -> usize {
- 0 + ::heapsize::HeapSize::heap_size_of_children(&self.a)
- + ::heapsize::HeapSize::heap_size_of_children(&self.b)
- + ::heapsize::HeapSize::heap_size_of_children(&self.c)
- + ::heapsize::HeapSize::heap_size_of_children(&self.d)
+ 0 + heapsize::HeapSize::heap_size_of_children(&self.a)
+ + heapsize::HeapSize::heap_size_of_children(&self.b)
+ + heapsize::HeapSize::heap_size_of_children(&self.c)
+ + heapsize::HeapSize::heap_size_of_children(&self.d)
}
}
```
diff --git a/examples/heapsize/heapsize_derive/src/lib.rs b/examples/heapsize/heapsize_derive/src/lib.rs
index ad9bb48..9176b29 100644
--- a/examples/heapsize/heapsize_derive/src/lib.rs
+++ b/examples/heapsize/heapsize_derive/src/lib.rs
@@ -22,7 +22,7 @@
let expanded = quote! {
// The generated impl.
- impl #impl_generics ::heapsize::HeapSize for #name #ty_generics #where_clause {
+ impl #impl_generics heapsize::HeapSize for #name #ty_generics #where_clause {
fn heap_size_of_children(&self) -> usize {
#sum
}
@@ -37,7 +37,7 @@
fn add_trait_bounds(mut generics: Generics) -> Generics {
for param in &mut generics.params {
if let GenericParam::Type(ref mut type_param) = *param {
- type_param.bounds.push(parse_quote!(::heapsize::HeapSize));
+ type_param.bounds.push(parse_quote!(heapsize::HeapSize));
}
}
generics
@@ -64,7 +64,7 @@
let recurse = fields.named.iter().map(|f| {
let name = &f.ident;
quote_spanned! {f.span()=>
- ::heapsize::HeapSize::heap_size_of_children(&self.#name)
+ heapsize::HeapSize::heap_size_of_children(&self.#name)
}
});
quote! {
@@ -78,7 +78,7 @@
let recurse = fields.unnamed.iter().enumerate().map(|(i, f)| {
let index = Index::from(i);
quote_spanned! {f.span()=>
- ::heapsize::HeapSize::heap_size_of_children(&self.#index)
+ heapsize::HeapSize::heap_size_of_children(&self.#index)
}
});
quote! {
diff --git a/examples/lazy-static/lazy-static/src/lib.rs b/examples/lazy-static/lazy-static/src/lib.rs
index f90ea8b..5481a30 100644
--- a/examples/lazy-static/lazy-static/src/lib.rs
+++ b/examples/lazy-static/lazy-static/src/lib.rs
@@ -98,7 +98,7 @@
// 10 | static ref PTR: *const () = &();
// | ^^^^^^^^^ `*const ()` cannot be shared between threads safely
let assert_sync = quote_spanned! {ty.span()=>
- struct _AssertSync where #ty: ::std::marker::Sync;
+ struct _AssertSync where #ty: std::marker::Sync;
};
// Check for Sized. Not vital to check here, but the error message is less
@@ -111,7 +111,7 @@
// 10 | static ref A: str = "";
// | ^^^ `str` does not have a constant size known at compile-time
let assert_sized = quote_spanned! {ty.span()=>
- struct _AssertSized where #ty: ::std::marker::Sized;
+ struct _AssertSized where #ty: std::marker::Sized;
};
let init_ptr = quote_spanned! {init.span()=>
@@ -121,14 +121,14 @@
let expanded = quote! {
#visibility struct #name;
- impl ::std::ops::Deref for #name {
+ impl std::ops::Deref for #name {
type Target = #ty;
fn deref(&self) -> &#ty {
#assert_sync
#assert_sized
- static ONCE: ::std::sync::Once = ::std::sync::ONCE_INIT;
+ static ONCE: std::sync::Once = std::sync::ONCE_INIT;
static mut VALUE: *mut #ty = 0 as *mut #ty;
unsafe {