Skip to content

Commit e2845c6

Browse files
committed
Expand Nfs into typed struct
1 parent f0f2aa3 commit e2845c6

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

functional/generics-type-classes.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,16 +127,19 @@ mod proto_trait {
127127
type AuthInfo;
128128
fn auth_info(&self) -> Self::AuthInfo;
129129
}
130-
pub struct Nfs(nfs::AuthInfo, PathBuf); // the mount point metadata
130+
pub struct Nfs {
131+
auth: nfs::AuthInfo,
132+
mount_point: PathBuf,
133+
}
131134
impl Nfs {
132135
pub(crate) fn mount_point(&self) -> &Path {
133-
&self.1
136+
&self.mount_point
134137
}
135138
}
136139
impl ProtoKind for Nfs {
137140
type AuthInfo = nfs::AuthInfo;
138141
fn auth_info(&self) -> Self::AuthInfo {
139-
self.0.clone()
142+
self.auth.clone()
140143
}
141144
}
142145
pub struct Bootp(); // no additional metadata

0 commit comments

Comments
 (0)