coreapi unixfile: simplify RawNode case
License: MIT Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
Łukasz Magiera committed
Oct 4, 2018 at 04:07 UTC
051c33087ba52461d1708da1e18c06bab57af4df
1 file changed
-8
core/coreapi/unixfile.go
-8
@@ -1,11 +1,9 @@
1
package coreapi
2
3
import (
4
- "bytes"
4
"context"
5
"errors"
6
"io"
8
- "io/ioutil"
7
"os"
8
gopath "path"
9
"time"
@@ -172,12 +170,6 @@ func newUnixfsFile(ctx context.Context, dserv ipld.DAGService, nd ipld.Node, nam
170
}
171
172
case *dag.RawNode:
175
- r := ioutil.NopCloser(bytes.NewReader(dn.RawData()))
176
- fi := &sizeInfo{
177
- size: int64(len(dn.RawData())),
178
- }
179
-
180
- return files.NewReaderFile("", "", r, fi), nil
173
default:
174
return nil, errors.New("unknown node type")
175
}