@@ -64,11 +64,6 @@ pub mod text;
64
64
pub mod text_list;
65
65
pub mod traits;
66
66
67
- #[ cfg( feature = "alloc" ) ]
68
- use alloc:: string:: String ;
69
- #[ cfg( feature = "alloc" ) ]
70
- use alloc:: vec:: Vec ;
71
-
72
67
///
73
68
/// 8 bytes, aligned to an 8-byte boundary.
74
69
///
@@ -93,7 +88,7 @@ pub const fn word(b0: u8, b1: u8, b2: u8, b3: u8, b4: u8, b5: u8, b6: u8, b7: u8
93
88
impl Word {
94
89
/// Allocates a vec of `length` words, all set to zero.
95
90
#[ cfg( feature = "alloc" ) ]
96
- pub fn allocate_zeroed_vec ( length : usize ) -> Vec < Self > {
91
+ pub fn allocate_zeroed_vec ( length : usize ) -> alloc :: vec :: Vec < Self > {
97
92
vec ! [ word( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ) ; length]
98
93
}
99
94
@@ -175,7 +170,7 @@ pub struct Error {
175
170
176
171
/// Extra context about error
177
172
#[ cfg( feature = "alloc" ) ]
178
- pub extra : String ,
173
+ pub extra : alloc :: string :: String ,
179
174
}
180
175
181
176
/// The general nature of an error. The purpose of this enum is not to describe the error itself,
@@ -411,7 +406,7 @@ impl Error {
411
406
}
412
407
413
408
#[ cfg( feature = "alloc" ) ]
414
- pub fn failed ( description : String ) -> Self {
409
+ pub fn failed ( description : alloc :: string :: String ) -> Self {
415
410
Self {
416
411
extra : description,
417
412
kind : ErrorKind :: Failed ,
@@ -424,27 +419,27 @@ impl Error {
424
419
#[ cfg( feature = "alloc" ) ]
425
420
return Self {
426
421
kind,
427
- extra : String :: new ( ) ,
422
+ extra : alloc :: string :: String :: new ( ) ,
428
423
} ;
429
424
}
430
425
431
426
#[ cfg( feature = "alloc" ) ]
432
- pub fn overloaded ( description : String ) -> Self {
427
+ pub fn overloaded ( description : alloc :: string :: String ) -> Self {
433
428
Self {
434
429
extra : description,
435
430
kind : ErrorKind :: Overloaded ,
436
431
}
437
432
}
438
433
#[ cfg( feature = "alloc" ) ]
439
- pub fn disconnected ( description : String ) -> Self {
434
+ pub fn disconnected ( description : alloc :: string :: String ) -> Self {
440
435
Self {
441
436
extra : description,
442
437
kind : ErrorKind :: Disconnected ,
443
438
}
444
439
}
445
440
446
441
#[ cfg( feature = "alloc" ) ]
447
- pub fn unimplemented ( description : String ) -> Self {
442
+ pub fn unimplemented ( description : alloc :: string :: String ) -> Self {
448
443
Self {
449
444
extra : description,
450
445
kind : ErrorKind :: Unimplemented ,
@@ -628,7 +623,7 @@ pub enum OutputSegments<'a> {
628
623
SingleSegment ( [ & ' a [ u8 ] ; 1 ] ) ,
629
624
630
625
#[ cfg( feature = "alloc" ) ]
631
- MultiSegment ( Vec < & ' a [ u8 ] > ) ,
626
+ MultiSegment ( alloc :: vec :: Vec < & ' a [ u8 ] > ) ,
632
627
}
633
628
634
629
impl < ' a > core:: ops:: Deref for OutputSegments < ' a > {
0 commit comments