Skip to content

Commit c00a21c

Browse files
authored
Rollup merge of #70694 - lzutao:self, r=Centril
Use Self over specific type in return position
2 parents e07f57c + f87afec commit c00a21c

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/libstd/fs.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -734,7 +734,7 @@ impl OpenOptions {
734734
/// let file = options.read(true).open("foo.txt");
735735
/// ```
736736
#[stable(feature = "rust1", since = "1.0.0")]
737-
pub fn new() -> OpenOptions {
737+
pub fn new() -> Self {
738738
OpenOptions(fs_imp::OpenOptions::new())
739739
}
740740

@@ -751,7 +751,7 @@ impl OpenOptions {
751751
/// let file = OpenOptions::new().read(true).open("foo.txt");
752752
/// ```
753753
#[stable(feature = "rust1", since = "1.0.0")]
754-
pub fn read(&mut self, read: bool) -> &mut OpenOptions {
754+
pub fn read(&mut self, read: bool) -> &mut Self {
755755
self.0.read(read);
756756
self
757757
}
@@ -772,7 +772,7 @@ impl OpenOptions {
772772
/// let file = OpenOptions::new().write(true).open("foo.txt");
773773
/// ```
774774
#[stable(feature = "rust1", since = "1.0.0")]
775-
pub fn write(&mut self, write: bool) -> &mut OpenOptions {
775+
pub fn write(&mut self, write: bool) -> &mut Self {
776776
self.0.write(write);
777777
self
778778
}
@@ -819,7 +819,7 @@ impl OpenOptions {
819819
/// let file = OpenOptions::new().append(true).open("foo.txt");
820820
/// ```
821821
#[stable(feature = "rust1", since = "1.0.0")]
822-
pub fn append(&mut self, append: bool) -> &mut OpenOptions {
822+
pub fn append(&mut self, append: bool) -> &mut Self {
823823
self.0.append(append);
824824
self
825825
}
@@ -839,7 +839,7 @@ impl OpenOptions {
839839
/// let file = OpenOptions::new().write(true).truncate(true).open("foo.txt");
840840
/// ```
841841
#[stable(feature = "rust1", since = "1.0.0")]
842-
pub fn truncate(&mut self, truncate: bool) -> &mut OpenOptions {
842+
pub fn truncate(&mut self, truncate: bool) -> &mut Self {
843843
self.0.truncate(truncate);
844844
self
845845
}
@@ -860,7 +860,7 @@ impl OpenOptions {
860860
/// let file = OpenOptions::new().write(true).create(true).open("foo.txt");
861861
/// ```
862862
#[stable(feature = "rust1", since = "1.0.0")]
863-
pub fn create(&mut self, create: bool) -> &mut OpenOptions {
863+
pub fn create(&mut self, create: bool) -> &mut Self {
864864
self.0.create(create);
865865
self
866866
}
@@ -893,7 +893,7 @@ impl OpenOptions {
893893
/// .open("foo.txt");
894894
/// ```
895895
#[stable(feature = "expand_open_options2", since = "1.9.0")]
896-
pub fn create_new(&mut self, create_new: bool) -> &mut OpenOptions {
896+
pub fn create_new(&mut self, create_new: bool) -> &mut Self {
897897
self.0.create_new(create_new);
898898
self
899899
}

0 commit comments

Comments
 (0)