@@ -72,7 +72,8 @@ impl Snapshot {
7272
7373 // Read in a [`Snapshot`] from a file.
7474 pub fn read_file ( p : impl AsRef < std:: path:: Path > ) -> Result < Snapshot , std:: io:: Error > {
75- Self :: read ( std:: fs:: File :: open ( p) ?)
75+ let reader = std:: io:: BufReader :: new ( std:: fs:: File :: open ( p) ?) ;
76+ Self :: read ( reader)
7677 }
7778
7879 // Write a [`Snapshot`] to a writer.
@@ -104,7 +105,8 @@ impl EventsSnapshot {
104105
105106 // Read in a [`EventsSnapshot`] from a file.
106107 pub fn read_file ( p : impl AsRef < std:: path:: Path > ) -> Result < EventsSnapshot , std:: io:: Error > {
107- Self :: read ( std:: fs:: File :: open ( p) ?)
108+ let reader = std:: io:: BufReader :: new ( std:: fs:: File :: open ( p) ?) ;
109+ Self :: read ( reader)
108110 }
109111
110112 // Write a [`EventsSnapshot`] to a writer.
@@ -154,7 +156,8 @@ impl AuthSnapshot {
154156
155157 // Read in a [`AuthSnapshot`] from a file.
156158 pub fn read_file ( p : impl AsRef < std:: path:: Path > ) -> Result < AuthSnapshot , std:: io:: Error > {
157- Self :: read ( std:: fs:: File :: open ( p) ?)
159+ let reader = std:: io:: BufReader :: new ( std:: fs:: File :: open ( p) ?) ;
160+ Self :: read ( reader)
158161 }
159162
160163 // Write a [`AuthSnapshot`] to a writer.
@@ -200,7 +203,8 @@ impl Generators {
200203
201204 // Read in a [`Generators`] from a file.
202205 pub fn read_file ( p : impl AsRef < std:: path:: Path > ) -> Result < Generators , std:: io:: Error > {
203- Self :: read ( std:: fs:: File :: open ( p) ?)
206+ let reader = std:: io:: BufReader :: new ( std:: fs:: File :: open ( p) ?) ;
207+ Self :: read ( reader)
204208 }
205209
206210 // Write a [`Generators`] to a writer.
0 commit comments