Skip to content

Commit

Permalink
Use unnamed arguements for single parameter functions
Browse files Browse the repository at this point in the history
  • Loading branch information
janaakhterov authored and qtbeee committed Nov 6, 2019
1 parent 68767cd commit 0444b3b
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions Sources/Hedera/file/FileAppendTransaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,28 @@ public class FileAppendTransaction: TransactionBuilder {
}

@discardableResult
public func setContents(data: Data) -> Self {
public func setContents(_ data: Data) -> Self {
body.fileAppend.contents = data

return self
}

@discardableResult
public func setContents(bytes: Bytes) -> Self {
public func setContents(_ bytes: Bytes) -> Self {
body.fileAppend.contents = Data(bytes)

return self
}

@discardableResult
public func setContents(string: String) -> Self {
public func setContents(_ string: String) -> Self {
body.fileAppend.contents = Data(Array(string.utf8))

return self
}

@discardableResult
public func setFile(id: FileId) -> Self {
public func setFile(_ id: FileId) -> Self {
body.fileAppend.fileID = id.toProto()

return self
Expand Down
6 changes: 3 additions & 3 deletions Sources/Hedera/file/FileCreateTransaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ public class FileCreateTransaction: TransactionBuilder {
}

@discardableResult
public func setContents(data: Data) -> Self {
public func setContents(_ data: Data) -> Self {
body.fileCreate.contents = data

return self
}

@discardableResult
public func setContents(bytes: Bytes) -> Self {
public func setContents(_ bytes: Bytes) -> Self {
body.fileCreate.contents = Data(bytes)

return self
}

@discardableResult
public func setContents(string: String) -> Self {
public func setContents(_ string: String) -> Self {
body.fileCreate.contents = Data(Array(string.utf8))

return self
Expand Down
2 changes: 1 addition & 1 deletion Sources/Hedera/file/FileDeleteTransaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class FileDeleteTransaction: TransactionBuilder {
}

@discardableResult
public func setFile(id: FileId) -> Self {
public func setFile(_ id: FileId) -> Self {
body.fileDelete.fileID = id.toProto()

return self
Expand Down
10 changes: 5 additions & 5 deletions Sources/Hedera/file/FileUpdateTransaction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,35 @@ public class FileUpdateTransaction: TransactionBuilder {
}

@discardableResult
public func setExpirationTime(date: Date) -> Self {
public func setExpirationTime(_ date: Date) -> Self {
body.fileUpdate.expirationTime = date.toProto()

return self
}

@discardableResult
public func setContents(data: Data) -> Self {
public func setContents(_ data: Data) -> Self {
body.fileUpdate.contents = data

return self
}

@discardableResult
public func setContents(bytes: Bytes) -> Self {
public func setContents(_ bytes: Bytes) -> Self {
body.fileUpdate.contents = Data(bytes)

return self
}

@discardableResult
public func setContents(string: String) -> Self {
public func setContents(_ string: String) -> Self {
body.fileUpdate.contents = Data(Array(string.utf8))

return self
}

@discardableResult
public func setFile(id: FileId) -> Self {
public func setFile(_ id: FileId) -> Self {
body.fileUpdate.fileID = id.toProto()

return self
Expand Down

0 comments on commit 0444b3b

Please sign in to comment.